vlc | branch: master | Filip Roséen <[email protected]> | Mon Jul 30 07:25:14 2018 
+0200| [ace5c8805deeb8d63fc6b62d33bf1748814f8ee5] | 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 <[email protected]>

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

 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 d3033b4b90..2281b3aa1a 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -564,14 +564,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("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( "satip-channellist-url" 
);

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to