Skip to content

Commit

Permalink
activation: Make sure response content is 0-terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Jul 4, 2017
1 parent b7e78e2 commit 4cebc98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/activation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4cebc98

Please sign in to comment.