|
From: | Patrick Klos |
Subject: | Re: [lwip-users] Potential NULL pointer access in ip4_frag.c |
Date: | Wed, 26 Apr 2017 09:56:56 -0400 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 4/26/2017 3:31 AM, Andreas Dinter
wrote:
Not having access to that specific version of LwIP, I can only comment on what the compiler is PROBABLY trying to warn you about. The only way the compiler can KNOW you're not dereferencing a null pointer is for you to check for null explicitly first, maybe something like this: LWIP_ASSERT("sanity check linked list", prev != NULL);That would possibly get rid of your warning? (I think if LWIP_ASSERT was enabled, the code generated by the macro expansion would be enough to stop the warning, at least for 'prev'?) Patrick |
[Prev in Thread] | Current Thread | [Next in Thread] |