mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-21 12:44:13 +03:00
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.
This commit is contained in:
parent
d0b7f9768d
commit
523d9b965d
@ -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;
|
if ((p=strchr(line, '#'))) *p++='\n', *p=0;
|
||||||
|
|
||||||
for (p=line; *p && !isspace(*p); p++);
|
for (p=line; *p && !isspace(*p); p++);
|
||||||
|
if (!*p) continue;
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
if (__lookup_ipliteral(&iplit, line, AF_UNSPEC)<=0)
|
if (__lookup_ipliteral(&iplit, line, AF_UNSPEC)<=0)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user