From bb4310203afebd7f7a54939490d092deebc9f76d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 20 Feb 2009 12:35:53 +0100 Subject: [PATCH] Add trailing \0 to message length We always put a trailing 0 at the end of the message body. Reflect this fact in the length of the message. --- gst-libs/gst/rtsp/gstrtspconnection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 03ca5ccdff..a102a0cf2d 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1113,9 +1113,10 @@ build_next (GstRTSPBuilder * builder, GstRTSPMessage * message, if (res != GST_RTSP_OK) goto done; - /* we have the complete body now */ + /* we have the complete body now, store in the message adjusting the + * length to include the traling '\0' */ gst_rtsp_message_take_body (message, - (guint8 *) builder->body_data, builder->body_len); + (guint8 *) builder->body_data, builder->body_len + 1); builder->body_data = NULL; builder->body_len = 0;