summaryrefslogtreecommitdiff
path: root/src/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-28 16:28:49 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-28 16:28:49 +0100
commit595bfd57dc8179f9588e2a8d1e0efd1194e6246c (patch)
tree3f1b89d8e23934b9539aa67f1b8d98e1fe54844b /src/ot_http.c
parent1c356825832e549570c690a170a84270022578e5 (diff)
Ensure one byte in the reply buffer for the terminator
Diffstat (limited to 'src/ot_http.c')
-rw-r--r--src/ot_http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ot_http.c b/src/ot_http.c
index 20ec1a6..406fec3 100644
--- a/src/ot_http.c
+++ b/src/ot_http.c
@@ -690,7 +690,8 @@ static ssize_t http_handle_announce(const int64_t sock, struct ot_workstruct
690 case 7: /* matched "ip" */ 690 case 7: /* matched "ip" */
691 { 691 {
692 char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16; 692 char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16;
693 len = urlencoded_parse(&read_ptr, tmp_buf2, ws->outbuf + G_OUTBUF_SIZE, SCAN_SEARCHPATH_VALUE); 693 /* One short of the end, for the terminator below */
694 len = urlencoded_parse(&read_ptr, tmp_buf2, ws->outbuf + G_OUTBUF_SIZE - 1, SCAN_SEARCHPATH_VALUE);
694 if (len <= 0) 695 if (len <= 0)
695 HTTPERROR_400_PARAM; 696 HTTPERROR_400_PARAM;
696 tmp_buf2[len] = 0; 697 tmp_buf2[len] = 0;