Slight memcpy paranoia.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4713 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-12-30 21:41:48 +00:00
parent c1890775dc
commit 9d1476a760

View File

@ -230,9 +230,12 @@ static void _http_add_body_bytes(tf_http_connection_t* connection, const void* d
{ {
if (connection->is_websocket) if (connection->is_websocket)
{ {
connection->body = tf_realloc(connection->body, connection->body_length + size); if (size)
memcpy((char*)connection->body + connection->body_length, data, size); {
connection->body_length += size; connection->body = tf_realloc(connection->body, connection->body_length + size);
memcpy((char*)connection->body + connection->body_length, data, size);
connection->body_length += size;
}
while (connection->body_length >= 2) while (connection->body_length >= 2)
{ {