1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

buflist: append: treat NULL additional buf as error not assert

Very very occasionally on server we try to add a NULL buffer to a buflist.

Let's try dealing with that by failing (caller must always be able to
handle failure from OOM) rather than asserting.
This commit is contained in:
Andy Green 2023-11-11 07:37:40 +00:00
parent bfce9f8618
commit 288f36fc81

View file

@ -39,7 +39,9 @@ lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf,
void *p = *head;
int sanity = 1024;
assert(buf);
if (!buf)
return -1;
assert(len);
/* append at the tail */