From aa5a63be146ba3cf2b6c1560030c6532117fa0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 23 Oct 2020 10:53:26 +0300 Subject: [PATCH] Fix debug argument concatenation The buffer was shorter than the arguments given to it which caused a heap buffer overflow. --- server/core/gateway.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/gateway.cc b/server/core/gateway.cc index bfc99d85f..a4155f325 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -3322,7 +3322,7 @@ static bool handle_debug_args(char* args) size_t total_len = 1; for (int i = 0; debug_arguments[i].action != NULL; i++) { - total_len += strlen(debug_arguments[i].name) + 1; + total_len += strlen(debug_arguments[i].name) + 2; } char arglist[total_len]; arglist[0] = '\0';