[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] accept differs from BSD/linux operation on NULL args
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] accept differs from BSD/linux operation on NULL args |
Date: |
Mon, 12 May 2008 14:23:14 +0100 |
On Sat, 2008-05-10 at 00:25 -0400, Rishi Khan wrote:
> in lwip_accept (in sockets.c) there is this code:
>
> memset(&sin, 0, sizeof(sin));
> sin.sin_len = sizeof(sin);
> sin.sin_family = AF_INET;
> sin.sin_port = htons(port);
> sin.sin_addr.s_addr = naddr.addr;
>
> if (*addrlen > sizeof(sin))
> *addrlen = sizeof(sin);
>
> SMEMCPY(addr, &sin, *addrlen);
>
> When addrlen and or addr are NULL, this code crashes. Most BSD and
> linux implementations allow it to be NULL. Could/should we change
> this code to be enclosed in:
> if (addr != NULL)
> {
> ...
> }
I'd suggest filing a bug, otherwise we're likely to forget changes like
these.
Kieran