summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Radizi <patrick.radizi@axis.com>2010-02-18 12:42:53 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-02-18 18:00:38 +0000
commita8f51d61f7e55d48b38b481ec0d50206b06e896e (patch)
treef00040944e389525e628d8e1b2df2757c0d6db99
parent5685e0a4b79fd730c013e25f01fa754acac5c5c2 (diff)
rtspconnection: make sure not to dereference NULL username or password
Fixes #610268.
-rw-r--r--gst-libs/gst/rtsp/gstrtspconnection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c
index 813eefdd3..e501fe6cf 100644
--- a/gst-libs/gst/rtsp/gstrtspconnection.c
+++ b/gst-libs/gst/rtsp/gstrtspconnection.c
@@ -946,6 +946,9 @@ add_auth_header (GstRTSPConnection * conn, GstRTSPMessage * message)
gchar *user_pass64;
gchar *auth_string;
+ if (conn->username == NULL || conn->passwd == NULL)
+ break;
+
user_pass = g_strdup_printf ("%s:%s", conn->username, conn->passwd);
user_pass64 = g_base64_encode ((guchar *) user_pass, strlen (user_pass));
auth_string = g_strdup_printf ("Basic %s", user_pass64);
@@ -967,7 +970,8 @@ add_auth_header (GstRTSPConnection * conn, GstRTSPMessage * message)
const gchar *method;
/* we need to have some params set */
- if (conn->auth_params == NULL)
+ if (conn->auth_params == NULL || conn->username == NULL ||
+ conn->passwd == NULL)
break;
/* we need the realm and nonce */