]> git.sesse.net Git - ffmpeg/commitdiff
avformat/libssh: check the user provided a password before trying to use it
authorJames Almer <jamrial@gmail.com>
Sun, 11 Jun 2017 17:17:30 +0000 (14:17 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 17 Jun 2017 20:16:13 +0000 (17:16 -0300)
Fixes ticket #6413

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/libssh.c

index 49e92e7516fc6a896c09e35700ead93d6d62033a..9e3d4da45eff0e471ea1661aa03bee63d232bad5 100644 (file)
@@ -103,7 +103,7 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user
         }
     }
 
-    if (!authorized && (auth_methods & SSH_AUTH_METHOD_PASSWORD)) {
+    if (!authorized && password && (auth_methods & SSH_AUTH_METHOD_PASSWORD)) {
         if (ssh_userauth_password(libssh->session, NULL, password) == SSH_AUTH_SUCCESS) {
             av_log(libssh, AV_LOG_DEBUG, "Authentication successful with password.\n");
             authorized = 1;