From 9314b5d4ce450fb2fe859639b2ddbc7b57ae18d5 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 18 Jan 2013 14:54:28 +0100 Subject: [PATCH] astraceroute: memset() buffer before file read Otherwise we might end up using some garbage from that buffer when parsing the port information and thus get an invalid port. Signed-off-by: Tobias Klauser --- src/astraceroute.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/astraceroute.c b/src/astraceroute.c index 5c347397..27fd769a 100644 --- a/src/astraceroute.c +++ b/src/astraceroute.c @@ -947,6 +947,7 @@ static void parse_whois_or_die(struct ash_cfg *cfg) fd = open_or_die(WHOIS_SERVER_SOURCE, O_RDONLY); + memset(tmp, 0, sizeof(tmp)); while ((ret = read(fd, tmp, sizeof(tmp))) > 0) { tmp[sizeof(tmp) - 1] = 0; ptr = skips(tmp); -- 2.11.4.GIT