mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-29 18:32:46 +00:00
Fix usage of uninitialized data in nd6.c because of unchecked pbuf_copy_partial() return value
This commit is contained in:
parent
aef3d2cb87
commit
2137f49d32
@ -447,7 +447,12 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
||||
buffer = &((u8_t*)p->payload)[offset];
|
||||
} else {
|
||||
buffer = nd6_ra_buffer;
|
||||
pbuf_copy_partial(p, buffer, sizeof(struct prefix_option), offset);
|
||||
if (pbuf_copy_partial(p, buffer, sizeof(struct prefix_option), offset) != sizeof(struct prefix_option)) {
|
||||
pbuf_free(p);
|
||||
ND6_STATS_INC(nd6.lenerr);
|
||||
ND6_STATS_INC(nd6.drop);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (buffer[1] == 0) {
|
||||
/* zero-length extension. drop packet */
|
||||
|
Loading…
x
Reference in New Issue
Block a user