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:
parent
bfce9f8618
commit
288f36fc81
1 changed files with 3 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue