Add trailing \0 to message length
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 20 Feb 2009 11:35:53 +0000 (12:35 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 20 Feb 2009 11:35:53 +0000 (12:35 +0100)
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

index 03ca5cc..a102a0c 100644 (file)
@@ -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;