summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-24 05:58:30 +0200
committerDirk Engling <erdgeist@erdgeist.org>2026-10-24 05:58:30 +0200
commit656be1fee7b3a9307458a098efbe7ebc9de305c5 (patch)
tree2e304a896d8ee98c304e2d27f1830ef7fb6bfac8 /ot_http.c
parent2cb9b191b66a69aba15ebdefe8cd4bdd962e5b2b (diff)
Null terminate the request at the final return and not after it, preventing a buffer overrun
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ot_http.c b/ot_http.c
index 626547b..3174002 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -305,7 +305,7 @@ static ssize_t http_handle_stats(const int64 sock, struct ot_workstruct *ws, cha
305 struct http_data *cookie = io_getcookie(sock); 305 struct http_data *cookie = io_getcookie(sock);
306 tai6464 t; 306 tai6464 t;
307#ifdef WANT_COMPRESSION_GZIP 307#ifdef WANT_COMPRESSION_GZIP
308 ws->request[ws->request_size] = 0; 308 ws->request[ws->request_size - 1] = 0;
309#ifndef WANT_COMPRESSION_GZIP_ALWAYS 309#ifndef WANT_COMPRESSION_GZIP_ALWAYS
310 if (strstr(read_ptr - 1, "gzip")) { 310 if (strstr(read_ptr - 1, "gzip")) {
311#endif 311#endif