mirror of
git://git.musl-libc.org/musl
synced 2025-01-03 04:52:03 +00:00
fix stack-based oob memory clobber in resolver's result sorting
commit 4f35eb7591
introduced this bug.
it is not present in any released versions. inadvertent use of the &
operator on an array into which we're indexing produced arithmetic on
the wrong-type pointer, with undefined behavior.
This commit is contained in:
parent
d0d212525e
commit
64466094ed
@ -394,7 +394,7 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], c
|
||||
key |= DAS_USABLE;
|
||||
if (!getsockname(fd, sa, &salen)) {
|
||||
if (family == AF_INET) memcpy(
|
||||
&sa6.sin6_addr.s6_addr+12,
|
||||
sa6.sin6_addr.s6_addr+12,
|
||||
&sa4.sin_addr, 4);
|
||||
if (dscope == scopeof(&sa6.sin6_addr))
|
||||
key |= DAS_MATCHINGSCOPE;
|
||||
|
Loading…
Reference in New Issue
Block a user