Skip to content

Commit

Permalink
pbuf_cat: add a simple check to ensure we don't cat the same pbuf to …
Browse files Browse the repository at this point in the history
…itself
  • Loading branch information
goldsimon committed Oct 12, 2023
1 parent 6864eb1 commit efe78e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/pbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ pbuf_cat(struct pbuf *h, struct pbuf *t)

LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
((h != NULL) && (t != NULL)), return;);
LWIP_ASSERT("Creating an infinite loop", h != t);

/* proceed to last pbuf of chain */
for (p = h; p->next != NULL; p = p->next) {
Expand Down

0 comments on commit efe78e7

Please sign in to comment.