From 6d1fdf60a339028405a3dd69101d289a7cca6fec Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 18 Mar 2008 11:20:05 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ gst-libs/gst/sdp/gstsdpmessage.c | 31 ++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c79f49..0f66351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-03-18 Wim Taymans + * 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 + Patch by: Ole André Vadla Ravnås * gst-libs/gst/rtsp/gstrtspconnection.c: diff --git a/gst-libs/gst/sdp/gstsdpmessage.c b/gst-libs/gst/sdp/gstsdpmessage.c index 8bf1c7c..0f4e9b4 100644 --- a/gst-libs/gst/sdp/gstsdpmessage.c +++ b/gst-libs/gst/sdp/gstsdpmessage.c @@ -66,6 +66,7 @@ #endif #include /* for G_OS_WIN32 */ +#include /* 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; -- 2.7.4