mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
rtsp-media: Don't crash on encrypted RTX SDP
In parse_keymgmt(), don't mutate the input string that's been passed as const, especially since we might need the original value again if the same key info applies to multiple streams (RTX, for example). https://bugzilla.gnome.org/show_bug.cgi?id=754753
This commit is contained in:
parent
22b618836e
commit
315c2f93bb
1 changed files with 19 additions and 9 deletions
|
@ -3356,7 +3356,6 @@ static gboolean
|
|||
parse_keymgmt (const gchar * keymgmt, GstCaps * caps)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
gchar *p, *kmpid;
|
||||
gsize size;
|
||||
guchar *data;
|
||||
GstMIKEYMessage *msg;
|
||||
|
@ -3364,17 +3363,28 @@ parse_keymgmt (const gchar * keymgmt, GstCaps * caps)
|
|||
const gchar *srtp_cipher;
|
||||
const gchar *srtp_auth;
|
||||
|
||||
p = (gchar *) keymgmt;
|
||||
{
|
||||
gchar *orig_value;
|
||||
gchar *p, *kmpid;
|
||||
|
||||
p = orig_value = g_strdup (keymgmt);
|
||||
|
||||
SKIP_SPACES (p);
|
||||
if (*p == '\0')
|
||||
if (*p == '\0') {
|
||||
g_free (orig_value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PARSE_STRING (p, " ", kmpid);
|
||||
if (!g_str_equal (kmpid, "mikey"))
|
||||
if (kmpid == NULL || !g_str_equal (kmpid, "mikey")) {
|
||||
g_free (orig_value);
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
data = g_base64_decode (p, &size);
|
||||
|
||||
g_free (orig_value); /* Don't need this any more */
|
||||
}
|
||||
|
||||
if (data == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue