projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0b7f97
)
fix potential read past end of buffer in getnameinfo host name lookup
author
Alexey Izbyshev
<izbyshev@ispras.ru>
Sat, 25 Feb 2023 15:41:32 +0000
(18:41 +0300)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 27 Feb 2023 15:04:34 +0000
(10:04 -0500)
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
patch
|
blob
|
history
diff --git
a/src/network/getnameinfo.c
b/src/network/getnameinfo.c
index
080d3c0
..
7abe0fa
100644
(file)
--- 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;