From 595bfd57dc8179f9588e2a8d1e0efd1194e6246c Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 28 Nov 2026 16:28:49 +0100 Subject: Ensure one byte in the reply buffer for the terminator --- src/ot_http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 case 7: /* matched "ip" */ { char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16; - len = urlencoded_parse(&read_ptr, tmp_buf2, ws->outbuf + G_OUTBUF_SIZE, SCAN_SEARCHPATH_VALUE); + /* One short of the end, for the terminator below */ + len = urlencoded_parse(&read_ptr, tmp_buf2, ws->outbuf + G_OUTBUF_SIZE - 1, SCAN_SEARCHPATH_VALUE); if (len <= 0) HTTPERROR_400_PARAM; tmp_buf2[len] = 0; -- cgit v1.3