summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-07-04 03:40:47 +0200
committerGravatar Nikias Bassen2017-07-04 03:40:47 +0200
commit4cebc989676716543cf5758094708525ff07c2b1 (patch)
treef72c32bbd9a031d640b76d014a1a7aa2ef886c13
parentb7e78e276b2a72527b2fe6bf584707682681bcdd (diff)
downloadlibideviceactivation-4cebc989676716543cf5758094708525ff07c2b1.tar.gz
libideviceactivation-4cebc989676716543cf5758094708525ff07c2b1.tar.bz2
activation: Make sure response content is 0-terminated
-rw-r--r--src/activation.c3
1 files changed, 2 insertions, 1 deletions
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;
}