mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 17:43:39 +08:00
fix pbuf_split_64k() for zero-length pbufs
This commit is contained in:
@@ -1122,7 +1122,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
|
|||||||
struct pbuf *r = p->next;
|
struct pbuf *r = p->next;
|
||||||
|
|
||||||
/* continue until the total length (summed up as u16_t) overflows */
|
/* continue until the total length (summed up as u16_t) overflows */
|
||||||
while ((r != NULL) && ((u16_t)(tot_len_front + r->len) > tot_len_front)) {
|
while ((r != NULL) && ((u16_t)(tot_len_front + r->len) >= tot_len_front)) {
|
||||||
tot_len_front = (u16_t)(tot_len_front + r->len);
|
tot_len_front = (u16_t)(tot_len_front + r->len);
|
||||||
i = r;
|
i = r;
|
||||||
r = r->next;
|
r = r->next;
|
||||||
|
|||||||
Reference in New Issue
Block a user