gst/rtsp/rtspconnection.c: Don't set a data pointer to NULL and a size > 0 when we deal with empty packets.

Original commit message from CVS:
* gst/rtsp/rtspconnection.c: (read_body):
Don't set a data pointer to NULL and a size > 0 when we deal
with empty packets.
* gst/rtsp/rtspmessage.c: (rtsp_message_new_response),
(rtsp_message_init_response), (rtsp_message_init_data),
(rtsp_message_unset), (rtsp_message_free),
(rtsp_message_take_body):
Check that we can't create invalid empty packets.
This commit is contained in:
Wim Taymans 2006-11-15 17:44:01 +00:00
parent e8c55964bb
commit 0cbacacba3
3 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,15 @@
2006-11-15 Wim Taymans <wim@fluendo.com>
* gst/rtsp/rtspconnection.c: (read_body):
Don't set a data pointer to NULL and a size > 0 when we deal
with empty packets.
* gst/rtsp/rtspmessage.c: (rtsp_message_new_response),
(rtsp_message_init_response), (rtsp_message_init_data),
(rtsp_message_unset), (rtsp_message_free),
(rtsp_message_take_body):
Check that we can't create invalid empty packets.
2006-11-15 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Mark Nauwelaerts <manauw at skynet be>

View file

@ -588,8 +588,10 @@ read_body (RTSPConnection * conn, glong content_length, RTSPMessage * msg)
RTSP_CHECK (rtsp_connection_read (conn, body, content_length), read_error);
content_length += 1;
done:
rtsp_message_take_body (msg, (guint8 *) body, content_length + 1);
rtsp_message_take_body (msg, (guint8 *) body, content_length);
return RTSP_OK;

View file

@ -219,6 +219,7 @@ RTSPResult
rtsp_message_take_body (RTSPMessage * msg, guint8 * data, guint size)
{
g_return_val_if_fail (msg != NULL, RTSP_EINVAL);
g_return_val_if_fail (data != NULL || size == 0, RTSP_EINVAL);
if (msg->body)
g_free (msg->body);