forked from cory/tildefriends
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:
parent
c1890775dc
commit
9d1476a760
@ -229,10 +229,13 @@ static void _http_websocket_mask_in_place(uint8_t* p, uint32_t mask, size_t size
|
|||||||
static void _http_add_body_bytes(tf_http_connection_t* connection, const void* data, size_t size)
|
static void _http_add_body_bytes(tf_http_connection_t* connection, const void* data, size_t size)
|
||||||
{
|
{
|
||||||
if (connection->is_websocket)
|
if (connection->is_websocket)
|
||||||
|
{
|
||||||
|
if (size)
|
||||||
{
|
{
|
||||||
connection->body = tf_realloc(connection->body, connection->body_length + size);
|
connection->body = tf_realloc(connection->body, connection->body_length + size);
|
||||||
memcpy((char*)connection->body + connection->body_length, data, size);
|
memcpy((char*)connection->body + connection->body_length, data, size);
|
||||||
connection->body_length += size;
|
connection->body_length += size;
|
||||||
|
}
|
||||||
|
|
||||||
while (connection->body_length >= 2)
|
while (connection->body_length >= 2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user