zdsfs: fix out of bound access in config file parsing

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 <schnelle@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Stefan Haberland
2021-05-14 23:01:20 +02:00
committed by Jan Höppner
parent 0fafbcf3bb
commit 2ece47ee1a

View File

@@ -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);