Commit a8f51d61 authored by Patrick Radizi's avatar Patrick Radizi Committed by Tim-Philipp Müller
Browse files

rtspconnection: make sure not to dereference NULL username or password

Fixes #610268.
parent 5685e0a4
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment