1
0
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:
Sébastien Helleu
2024-04-24 21:24:51 +02:00
parent 1e08b1119a
commit 4baf0e8526
+4 -1
View File
@@ -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