summaryrefslogtreecommitdiff
path: root/src/http_chunk.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-10-11 12:23:21 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-10-19 21:40:14 -0400
commit9c25581d6fb20488d13e4b17f6f62212408ad04c (patch)
tree4e81270396ad8f35aac960ecccfefa364b2a8d58 /src/http_chunk.c
parent6d76f7ce4957b2974916261c619471e59ffb0acf (diff)
downloadlighttpd-git-9c25581d6fb20488d13e4b17f6f62212408ad04c.tar.gz
[core] alloc optim reading file, sending chunked
avoid potential double-copy due to not enough space for final '\0' in http_chunk_append_read_fd_range() if read size is exactly multiple of 8k and sending chunked response
Diffstat (limited to 'src/http_chunk.c')
-rw-r--r--src/http_chunk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http_chunk.c b/src/http_chunk.c
index fb76a99e..07bde8b5 100644
--- a/src/http_chunk.c
+++ b/src/http_chunk.c
@@ -77,7 +77,7 @@ static int http_chunk_append_read_fd_range(request_st * const r, const buffer *
http_chunk_len_append(cq, (uintmax_t)len);
if (0 != offset && -1 == lseek(fd, offset, SEEK_SET)) return -1;
- buffer * const b = chunkqueue_append_buffer_open_sz(cq, len+2);
+ buffer * const b = chunkqueue_append_buffer_open_sz(cq, len+2+1);
ssize_t rd;
offset = 0;
do {