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:
parent
98c8f686aa
commit
6074016782
4
netcat.c
4
netcat.c
|
@ -1104,7 +1104,7 @@ dol_noop:
|
||||||
errno = 0;
|
errno = 0;
|
||||||
x = 0; /* use as a flag... */
|
x = 0; /* use as a flag... */
|
||||||
if (rad) /* xxx: fix to go down the *list* if we have one? */
|
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;
|
x = 1;
|
||||||
if (rp)
|
if (rp)
|
||||||
if (z != rp)
|
if (z != rp)
|
||||||
|
@ -1402,7 +1402,7 @@ int dolisten6 (rad, rp, lad, lp)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
x = 0; /* use as a flag... */
|
x = 0; /* use as a flag... */
|
||||||
if (rad) /* xxx: fix to go down the *list* if we have one? */
|
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;
|
x = 1;
|
||||||
if (rp)
|
if (rp)
|
||||||
if (z != rp)
|
if (z != rp)
|
||||||
|
|
Loading…
Reference in New Issue