From 2ece47ee1ac3d5b448680264d948f6c50a76af56 Mon Sep 17 00:00:00 2001 From: Stefan Haberland Date: Fri, 14 May 2021 23:01:20 +0200 Subject: [PATCH] zdsfs: fix out of bound access in config file parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tmp buffer is one byte too short missing space for the final \0 byte leading to out of bound access. Fix by increasing the buffer by one. Reported-by: Niklas Schnelle Signed-off-by: Stefan Haberland Reviewed-by: Niklas Schnelle Signed-off-by: Jan Höppner --- zdsfs/zdsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdsfs/zdsfs.c b/zdsfs/zdsfs.c index 59587324..ceadd341 100644 --- a/zdsfs/zdsfs.c +++ b/zdsfs/zdsfs.c @@ -1400,7 +1400,7 @@ static void zdsfs_process_config_file(const char *config) continue; /* remove all whitespaces */ - tmp = util_malloc(strlen(line)); + tmp = util_malloc(strlen(line) + 1); remove_whitespace(line, tmp); key = strtok(tmp, delimiter);