lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #59831] tcp_output : Null dereferencing


From: Evan Lojewski
Subject: [lwip-devel] [bug #59831] tcp_output : Null dereferencing
Date: Mon, 18 Jan 2021 00:25:23 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

Follow-up Comment #2, bug #59831 (project lwip):

I've also run into this issue when attempting to integrate lwip into one of my
projects.

Also note that both scan-build from clang and pclint are detecting that a null
deference is present at
https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_out.c#n1390

>From scan-build:
 ../libs/lwip/lwip/src/core/tcp_out.c:1390:67: warning: Access to field
'tcphdr' results in a dereference of a null pointer (loaded from variable
'useg')
        if (TCP_SEQ_LT(lwip_ntohl(seg->tcphdr->seqno),
lwip_ntohl(useg->tcphdr->seqno))) {
                                                                 
^~~~~~~~~~~~
../libs/lwip/lwip/src/include/lwip/def.h:103:34: note: expanded from macro
'lwip_ntohl'
#define lwip_ntohl(x) lwip_htonl(x)
                                 ^
../libs/lwip/lwip/src/include/lwip/priv/tcp_priv.h:109:60: note: expanded from
macro 'TCP_SEQ_LT'
#define TCP_SEQ_LT(a,b)     (((u32_t)((u32_t)(a) - (u32_t)(b)) & 0x80000000u)
!= 0)



>From pclint:
        if (TCP_SEQ_LT(lwip_ntohl(seg->tcphdr->seqno),
lwip_ntohl(useg->tcphdr->seqno))) {
../libs/lwip/lwip/src/core/tcp_out.c  1390  Warning 613: Possible
    use of null pointer 'useg' in left argument to operator '->' [Reference:
    file ../libs/lwip/lwip/src/core/tcp_out.c: line 1329]
../libs/lwip/lwip/src/core/tcp_out.c  1329  Info 831: Reference
    cited in prior message

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?59831>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]