|
Message-Id: <20230225154132.240827-1-izbyshev@ispras.ru> Date: Sat, 25 Feb 2023 18:41:32 +0300 From: Alexey Izbyshev <izbyshev@...ras.ru> To: musl@...ts.openwall.com Subject: [PATCH] fix potential read past end of buffer in getnameinfo host name lookup This is completely analoguous to commit 633183b5d1c2. Similar code called from __lookup_name is not affected because it checks that the line contains the host name surrounded by blanks. --- src/network/getnameinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/getnameinfo.c b/src/network/getnameinfo.c index 949e1811..689b7d11 100644 --- a/src/network/getnameinfo.c +++ b/src/network/getnameinfo.c @@ -58,6 +58,7 @@ static void reverse_hosts(char *buf, const unsigned char *a, unsigned scopeid, i if ((p=strchr(line, '#'))) *p++='\n', *p=0; for (p=line; *p && !isspace(*p); p++); + if (!*p) continue; *p++ = 0; if (__lookup_ipliteral(&iplit, line, AF_UNSPEC)<=0) continue; -- 2.39.1
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.