lwip-members
[Top][All Lists]
Advanced

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

[lwip-members] [patch #8741] compiler message fix: don't call memcpy wit


From: chrysn
Subject: [lwip-members] [patch #8741] compiler message fix: don't call memcpy with NULL
Date: Wed, 16 Sep 2015 12:58:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1 Debian/unstable (3.16.3-1) Epiphany/3.16.3

URL:
  <http://savannah.nongnu.org/patch/?8741>

                 Summary: compiler message fix: don't call memcpy with NULL
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: chrysn
            Submitted on: Wed 16 Sep 2015 12:58:26 GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

memcpy is not supposed to be fed NULL pointers, even when size is 0. recent
gccs with sanitizer enabled throw error messages like that:

> src/netif/ppp/fsm.c:792:2: runtime error: null pointer passed as argument 2,
which is declared to never be null

there was a check until 4a7f2ffc, but it got dropped along with a check for
in-place copying (which was left in place as a comment on why this is not
required any more).

my patch restores the datalen check so that fsm_sdata can again be called with
data=NULL as long as datalen is 0 (which happens in practice; haven't tracked
it down any further, but it's not unexpected for such a function to receive a
NULL pointer when no data is to be read from there anyway).



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 16 Sep 2015 12:58:26 GMT  Name:
0001-don-t-call-memcpy-with-NULL-even-when-size-0.patch  Size: 890B   By:
chrysn

<http://savannah.nongnu.org/patch/download.php?file_id=34898>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8741>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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