mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 23:36:37 +02:00
relay: add final '\0' in body when parsing HTTP response
This fixes tests on Debian GNU/Hurd.
This commit is contained in:
@@ -1584,9 +1584,12 @@ relay_http_parse_response (const char *data)
|
||||
else if (http_resp->status == RELAY_HTTP_BODY)
|
||||
{
|
||||
http_resp->body_size = strlen (ptr_data);
|
||||
http_resp->body = malloc (http_resp->body_size);
|
||||
http_resp->body = malloc (http_resp->body_size + 1);
|
||||
if (http_resp->body)
|
||||
{
|
||||
memcpy (http_resp->body, ptr_data, http_resp->body_size);
|
||||
http_resp->body[http_resp->body_size] = '\0';
|
||||
}
|
||||
http_resp->status = RELAY_HTTP_END;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user