Allow fromlen == NULL in the recvfrom() wrapper.
This commit is contained in:
parent
f1639a47c4
commit
920ac1ae40
16
src/lib-fd.c
16
src/lib-fd.c
@ -389,18 +389,24 @@ RECV_T NEW(recvfrom)(int s, void *buf, size_t len, int flags,
|
|||||||
|
|
||||||
if(ret > 0)
|
if(ret > 0)
|
||||||
{
|
{
|
||||||
|
char tmp[128];
|
||||||
char *b = buf;
|
char *b = buf;
|
||||||
|
|
||||||
_zz_fuzz(s, buf, ret);
|
_zz_fuzz(s, buf, ret);
|
||||||
_zz_addpos(s, ret);
|
_zz_addpos(s, ret);
|
||||||
|
|
||||||
if(ret >= 4)
|
if (fromlen)
|
||||||
debug("%s(%i, %p, %li, 0x%x, %p, &%i) = %i \"%c%c%c%c...",
|
sprintf(tmp, "&%i", (int)*fromlen);
|
||||||
__func__, s, buf, (long int)len, flags, from, (int)*fromlen,
|
else
|
||||||
|
strcat(tmp, "NULL");
|
||||||
|
|
||||||
|
if (ret >= 4)
|
||||||
|
debug("%s(%i, %p, %li, 0x%x, %p, %s) = %i \"%c%c%c%c...",
|
||||||
|
__func__, s, buf, (long int)len, flags, from, tmp,
|
||||||
ret, b[0], b[1], b[2], b[3]);
|
ret, b[0], b[1], b[2], b[3]);
|
||||||
else
|
else
|
||||||
debug("%s(%i, %p, %li, 0x%x, %p, &%i) = %i \"%c...",
|
debug("%s(%i, %p, %li, 0x%x, %p, %s) = %i \"%c...",
|
||||||
__func__, s, buf, (long int)len, flags, from, (int)*fromlen,
|
__func__, s, buf, (long int)len, flags, from, tmp,
|
||||||
ret, b[0]);
|
ret, b[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user