ffmpeg | branch: release/3.0 | James Almer <jamr...@gmail.com> | Sun Jun 11 
14:17:30 2017 -0300| [ef95789c8c492e86f21d9a5224745abe6b662cbe] | committer: 
James Almer

avformat/libssh: check the user provided a password before trying to use it

Fixes ticket #6413

Reviewed-by: Michael Niedermayer <mich...@niedermayer.cc>
Signed-off-by: James Almer <jamr...@gmail.com>
(cherry picked from commit 8ddb6820bd52df6ed616abc3d8be200b126aa8c1)

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

 libavformat/libssh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 3c056f874a..4cf7963e70 100644
--- a/libavformat/libssh.c
+++ b/libavformat/libssh.c
@@ -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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to