mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08: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];
|
buffer = &((u8_t*)p->payload)[offset];
|
||||||
} else {
|
} else {
|
||||||
buffer = nd6_ra_buffer;
|
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) {
|
if (buffer[1] == 0) {
|
||||||
/* zero-length extension. drop packet */
|
/* zero-length extension. drop packet */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user