diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-03-18 11:20:05 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-03-18 11:20:05 +0000 |
commit | 6d1fdf60a339028405a3dd69101d289a7cca6fec (patch) | |
tree | 514880109f3803eda572a92f6be5c4e6a2bab9f1 | |
parent | aca58fb8ac1bb9a9e62a750051897633cf6e3bda (diff) | |
download | gstreamer-plugins-base-6d1fdf60a339028405a3dd69101d289a7cca6fec.tar.gz |
gst-libs/gst/sdp/gstsdpmessage.c: Use GST_STR_NULL when trying to print strings that could be NULL because this might...
Original commit message from CVS:
* gst-libs/gst/sdp/gstsdpmessage.c: (gst_sdp_message_dump):
Use GST_STR_NULL when trying to print strings that could be NULL because
this might crash on some platforms. See #520808.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst-libs/gst/sdp/gstsdpmessage.c | 31 |
2 files changed, 22 insertions, 15 deletions
@@ -1,5 +1,11 @@ 2008-03-18 Wim Taymans <wim.taymans@collabora.co.uk> + * gst-libs/gst/sdp/gstsdpmessage.c: (gst_sdp_message_dump): + Use GST_STR_NULL when trying to print strings that could be NULL because + this might crash on some platforms. See #520808. + +2008-03-18 Wim Taymans <wim.taymans@collabora.co.uk> + Patch by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> * gst-libs/gst/rtsp/gstrtspconnection.c: diff --git a/gst-libs/gst/sdp/gstsdpmessage.c b/gst-libs/gst/sdp/gstsdpmessage.c index 8bf1c7cac..0f4e9b4da 100644 --- a/gst-libs/gst/sdp/gstsdpmessage.c +++ b/gst-libs/gst/sdp/gstsdpmessage.c @@ -66,6 +66,7 @@ #endif #include <glib.h> /* for G_OS_WIN32 */ +#include <gst/gstinfo.h> /* For GST_STR_NULL */ #ifdef G_OS_WIN32 #ifdef _MSC_VER @@ -1913,17 +1914,17 @@ gst_sdp_message_dump (const GstSDPMessage * msg) g_return_val_if_fail (msg != NULL, GST_SDP_EINVAL); g_print ("sdp packet %p:\n", msg); - g_print (" version: '%s'\n", msg->version); + g_print (" version: '%s'\n", GST_STR_NULL (msg->version)); g_print (" origin:\n"); - g_print (" username: '%s'\n", msg->origin.username); - g_print (" sess_id: '%s'\n", msg->origin.sess_id); - g_print (" sess_version: '%s'\n", msg->origin.sess_version); - g_print (" nettype: '%s'\n", msg->origin.nettype); - g_print (" addrtype: '%s'\n", msg->origin.addrtype); - g_print (" addr: '%s'\n", msg->origin.addr); - g_print (" session_name: '%s'\n", msg->session_name); - g_print (" information: '%s'\n", msg->information); - g_print (" uri: '%s'\n", msg->uri); + g_print (" username: '%s'\n", GST_STR_NULL (msg->origin.username)); + g_print (" sess_id: '%s'\n", GST_STR_NULL (msg->origin.sess_id)); + g_print (" sess_version: '%s'\n", GST_STR_NULL (msg->origin.sess_version)); + g_print (" nettype: '%s'\n", GST_STR_NULL (msg->origin.nettype)); + g_print (" addrtype: '%s'\n", GST_STR_NULL (msg->origin.addrtype)); + g_print (" addr: '%s'\n", GST_STR_NULL (msg->origin.addr)); + g_print (" session_name: '%s'\n", GST_STR_NULL (msg->session_name)); + g_print (" information: '%s'\n", GST_STR_NULL (msg->information)); + g_print (" uri: '%s'\n", GST_STR_NULL (msg->uri)); if (msg->emails->len > 0) { guint i; @@ -1942,14 +1943,14 @@ gst_sdp_message_dump (const GstSDPMessage * msg) } } g_print (" connection:\n"); - g_print (" nettype: '%s'\n", msg->connection.nettype); - g_print (" addrtype: '%s'\n", msg->connection.addrtype); - g_print (" address: '%s'\n", msg->connection.address); + g_print (" nettype: '%s'\n", GST_STR_NULL (msg->connection.nettype)); + g_print (" addrtype: '%s'\n", GST_STR_NULL (msg->connection.addrtype)); + g_print (" address: '%s'\n", GST_STR_NULL (msg->connection.address)); g_print (" ttl: '%u'\n", msg->connection.ttl); g_print (" addr_number: '%u'\n", msg->connection.addr_number); g_print (" key:\n"); - g_print (" type: '%s'\n", msg->key.type); - g_print (" data: '%s'\n", msg->key.data); + g_print (" type: '%s'\n", GST_STR_NULL (msg->key.type)); + g_print (" data: '%s'\n", GST_STR_NULL (msg->key.data)); if (msg->attributes->len > 0) { guint i; |