From 3c5398403d3c62cae7c40fb3bdfbe86765fc103c Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 21 Aug 2017 22:08:53 +0200 Subject: [PATCH] fix pbuf_split_64k() for zero-length pbufs --- src/core/pbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 90b774c5..a2daf715 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -1122,7 +1122,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest) struct pbuf *r = p->next; /* 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); i = r; r = r->next;