From 5dfd12b64c78fc8533bdd511a0b8879f9679fd13 Mon Sep 17 00:00:00 2001 From: Juan Navarro Date: Fri, 21 Dec 2018 10:59:22 +0100 Subject: [PATCH] rtspsrc: Accept NULL for "port-range" property The documentation of "port-range" implies that passing NULL should be valid, but currently it is not. Without this check, the sscanf() call will crash. --- gst/rtsp/gstrtspsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 1fe834bea7..9ecf014d47 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1574,7 +1574,7 @@ gst_rtspsrc_set_property (GObject * object, guint prop_id, const GValue * value, const gchar *str; str = g_value_get_string (value); - if (sscanf (str, "%u-%u", &rtspsrc->client_port_range.min, + if (str == NULL || sscanf (str, "%u-%u", &rtspsrc->client_port_range.min, &rtspsrc->client_port_range.max) != 2) { rtspsrc->client_port_range.min = 0; rtspsrc->client_port_range.max = 0;