]> git.sesse.net Git - vlc/commitdiff
Added a few malloc/strdup checks in ftp.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 9 Sep 2008 20:37:32 +0000 (22:37 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 9 Sep 2008 20:37:32 +0000 (22:37 +0200)
modules/access/ftp.c

index 0b2a410208f3b0b71a241d7a78a84242be2f2250..75878f431e3a55a69d9a29de0562bc770e23395b 100644 (file)
@@ -153,6 +153,8 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
         psz = strdup( p_sys->url.psz_username );
     else
         psz = var_CreateGetString( p_access, "ftp-user" );
+    if( !psz )
+        return -1;
 
     if( ftp_SendCommand( p_access, p_sys, "USER %s", psz ) < 0 ||
         ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )
@@ -173,6 +175,8 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
                 psz = strdup( p_sys->url.psz_password );
             else
                 psz = var_CreateGetString( p_access, "ftp-pwd" );
+            if( !psz )
+                return -1;
 
             if( ftp_SendCommand( p_access, p_sys, "PASS %s", psz ) < 0 ||
                 ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )