[vlc-commits] sd: upnp: parseSatipServer: add missing error check

Filip Roséen git at videolan.org
Wed Aug 1 13:19:11 CEST 2018


vlc/vlc-3.0 | branch: master | Filip Roséen <filip at atch.se> | Mon Jul 30 07:25:14 2018 +0200| [f0d804bb1bc981518404912a131211a380bf2e07] | committer: Hugo Beauzée-Luyssen

sd: upnp: parseSatipServer: add missing error check

Prevents a potential null-dereference on the line that follows.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit ace5c8805deeb8d63fc6b62d33bf1748814f8ee5)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f0d804bb1bc981518404912a131211a380bf2e07
---

 modules/services_discovery/upnp.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 2f2e99f32e..127f562837 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -592,14 +592,17 @@ MediaServerList::parseSatipServer( IXML_Element* p_device_element, const char *p
 {
     SD::MediaServerDesc* p_server = NULL;
 
-    vlc_url_t url;
-    vlc_UrlParse( &url, psz_base_url );
-
     char *psz_satip_channellist = config_GetPsz(m_sd, "satip-channelist");
     if( !psz_satip_channellist ) {
         psz_satip_channellist = strdup("Auto");
     }
 
+    if( unlikely( !psz_satip_channellist ) )
+        return;
+
+    vlc_url_t url;
+    vlc_UrlParse( &url, psz_base_url );
+
     /* Part 1: a user may have provided a custom playlist url */
     if (strncmp(psz_satip_channellist, "CustomList", 10) == 0) {
         char *psz_satip_playlist_url = config_GetPsz(m_sd, "satip-channellist-url" );



More information about the vlc-commits mailing list