diff --git a/lib/core/buflist.c b/lib/core/buflist.c index dbe544e5c..4b50f92b0 100644 --- a/lib/core/buflist.c +++ b/lib/core/buflist.c @@ -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 */