fix address size check

The rad pointer is an in_addr structure (IA), not a sockaddr structure
(SA), so make sure the memcmp call restricts itself to those many bytes.
This commit is contained in:
Mike Frysinger 2018-01-11 17:13:14 -05:00
parent 98c8f686aa
commit 6074016782
1 changed files with 2 additions and 2 deletions

View File

@ -1104,7 +1104,7 @@ dol_noop:
errno = 0;
x = 0; /* use as a flag... */
if (rad) /* xxx: fix to go down the *list* if we have one? */
if (memcmp (rad, whozis->iaddrs, sizeof (SA)))
if (memcmp (rad, whozis->iaddrs, sizeof (*rad)))
x = 1;
if (rp)
if (z != rp)
@ -1402,7 +1402,7 @@ int dolisten6 (rad, rp, lad, lp)
errno = 0;
x = 0; /* use as a flag... */
if (rad) /* xxx: fix to go down the *list* if we have one? */
if (memcmp (rad, whozis->iaddrs, sizeof (SAI6)))
if (memcmp (rad, whozis->iaddrs, sizeof (*rad)))
x = 1;
if (rp)
if (z != rp)