From 4cebc989676716543cf5758094708525ff07c2b1 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 4 Jul 2017 03:40:47 +0200 Subject: activation: Make sure response content is 0-terminated --- src/activation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/activation.c b/src/activation.c index d8cbc6f..537ae73 100644 --- a/src/activation.c +++ b/src/activation.c @@ -543,8 +543,9 @@ static size_t idevice_activation_write_callback(char* data, size_t size, size_t const size_t total = size * nmemb; if (total != 0) { - response->raw_content = realloc(response->raw_content, response->raw_content_size + total); + response->raw_content = realloc(response->raw_content, response->raw_content_size + total + 1); memcpy(response->raw_content + response->raw_content_size, data, total); + response->raw_content[response->raw_content_size + total] = '\0'; response->raw_content_size += total; } -- cgit v1.1-32-gdbae