mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-27 15:16:03 +00:00
pbuf_cat: add a simple check to ensure we don't cat the same pbuf to itself
This commit is contained in:
parent
6864eb1749
commit
efe78e7e5b
@ -860,6 +860,7 @@ pbuf_cat(struct pbuf *h, struct pbuf *t)
|
|||||||
|
|
||||||
LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
|
LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
|
||||||
((h != NULL) && (t != NULL)), return;);
|
((h != NULL) && (t != NULL)), return;);
|
||||||
|
LWIP_ASSERT("Creating an infinite loop", h != t);
|
||||||
|
|
||||||
/* proceed to last pbuf of chain */
|
/* proceed to last pbuf of chain */
|
||||||
for (p = h; p->next != NULL; p = p->next) {
|
for (p = h; p->next != NULL; p = p->next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user