From 26613f928cb32fa29e31310d0e330c9c3c32085c Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 1 Jul 2024 18:44:08 +0200 Subject: [PATCH] Fix heap buffer overflow in URLAsset handling --- src/restore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restore.c b/src/restore.c index 5c6011f5..d3828f96 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1235,7 +1235,7 @@ static size_t _curl_header_callback(char* buffer, size_t size, size_t nitems, vo key[i] = '\0'; i++; while (i < len && buffer[i] == ' ' || buffer[i] == '\t') i++; - val = malloc(len-i); + val = malloc(len-i+1); strncpy(val, buffer+i, len-i); val[len-i] = '\0'; break;