[riot-notifications] [RIOT-OS/RIOT] ### Contribution description (#11045)

Kaspar Schleiser notifications at github.com
Thu Feb 21 11:33:22 CET 2019


Fixes wrong assumption in memcpy length.
ip6_addr_t is >16.

```
stack.c: In function '_net_init':                                                                    
stack.c:207:5: error: 'memcpy' reading 20 bytes from a region of size 16 [-Werror=stringop-overflow=]           
     memcpy(&local6.addr, local6_a, sizeof(local6));                                                                                         
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                      
stack.c: In function '_prepare_send_checks':
stack.c:244:13: error: 'memcpy' reading 20 bytes from a region of size 16 [-Werror=stringop-overflow=]
             memcpy(&nc->next_hop_address, remote6, sizeof(ip6_addr_t));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

### Testing procedure

Compile for hifive1 with gcc >8.

### Issues/PRs references

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

  https://github.com/RIOT-OS/RIOT/pull/11045

-- Commit Summary --

  * tests/lwip_sock_ip: fix memcpy lenghts

-- File Changes --

    M tests/lwip_sock_ip/stack.c (4)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11045.patch
https://github.com/RIOT-OS/RIOT/pull/11045.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11045
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190221/d50ce6c8/attachment-0001.html>


More information about the notifications mailing list