mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
buflist: overallocate by 1
We overallocate at the start by LWS_PRE so we can use buflist content directly with lws_write, this has us also overallocate by 1 at the end. There's a corner case with cgi where it's receiving bulk POST data to pass on to cgi stdin and wants to make sure there's a NUL just past the end... this makes sure we have space for it.
This commit is contained in:
parent
cc425b1b98
commit
1c09e6e822
1 changed files with 2 additions and 2 deletions
|
@ -59,8 +59,8 @@ lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf,
|
|||
lwsl_info("%s: len %u first %d %p\n", __func__, (unsigned int)len,
|
||||
first, p);
|
||||
|
||||
nbuf = (struct lws_buflist *)lws_malloc(
|
||||
sizeof(struct lws_buflist) + len + LWS_PRE, __func__);
|
||||
nbuf = (struct lws_buflist *)lws_malloc(sizeof(struct lws_buflist) +
|
||||
len + LWS_PRE + 1, __func__);
|
||||
if (!nbuf) {
|
||||
lwsl_err("%s: OOM\n", __func__);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue