[riot-notifications] [RIOT-OS/RIOT] gnrs/pktbuf: avoid memcpy if size <= 0 (#10786)

Kaspar Schleiser notifications at github.com
Wed Jan 16 15:42:43 CET 2019

### Contribution description

ubsan complains about memcpy called with a NULL pointer. Though this only happens if the size parameter is 0, it should be avoided.

This PR solves this by moving the memcpy into the ```size > 0``` block.

### Testing procedure

No idea. Unittests should be enough?

### Issues/PRs references

Found via #10782.
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * gnrs/pktbuf: avoid memcpy if size <= 0

-- File Changes --

    M sys/net/gnrc/pktbuf_static/gnrc_pktbuf_static.c (6)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190116/21eb4c7c/attachment-0001.html>

More information about the notifications mailing list