Commit d176333b authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Do not allow message_offset to become negative when queuing messages

parent 2929c8fa
......@@ -491,7 +491,10 @@ add_to_be_sent (NiceSocket *sock, const NiceOutputMessage *message,
len = MIN (tbs->length - offset, buffer->size - message_offset);
memcpy (tbs->buf + offset, (guint8 *) buffer->buffer + message_offset, len);
offset += len;
message_offset -= len;
if (message_offset >= len)
message_offset -= len;
else
message_offset = 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment