summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <[email protected]>2017-06-11 14:17:30 -0300
committerJames Almer <[email protected]>2018-01-11 10:41:31 -0300
commitef95789c8c492e86f21d9a5224745abe6b662cbe (patch)
tree0581aa0f9073c93158bf924599f9ffaec95fa82b
parent2bc6b9b2a9c9f22b26ce2207f73f6e7a5aa7c0b9 (diff)
avformat/libssh: check the user provided a password before trying to use it
Fixes ticket #6413 Reviewed-by: Michael Niedermayer <[email protected]> Signed-off-by: James Almer <[email protected]> (cherry picked from commit 8ddb6820bd52df6ed616abc3d8be200b126aa8c1)
-rw-r--r--libavformat/libssh.c2
1 files changed, 1 insertions, 1 deletions
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;