Commit 0cbacacb authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/rtsp/rtspconnection.c: Don't set a data pointer to NULL and a size > 0...

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.
parent e8c55964
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>
......
......@@ -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;
......
......@@ -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);
......
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