aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/libssh.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-06-11 14:17:30 -0300
committerJames Almer <jamrial@gmail.com>2018-01-11 10:37:11 -0300
commit4fb5f391ae0b1de1a0cbdd98245829b3eea3ff51 (patch)
tree82392d1159bd96a4e5dd85cedad8bd6e3e1d063a /libavformat/libssh.c
parent4fb4a642c63f2a02f515d422b379c69fee6f77c3 (diff)
downloadffmpeg-4fb5f391ae0b1de1a0cbdd98245829b3eea3ff51.tar.gz
avformat/libssh: check the user provided a password before trying to use it
Fixes ticket #6413 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 8ddb6820bd52df6ed616abc3d8be200b126aa8c1)
Diffstat (limited to 'libavformat/libssh.c')
-rw-r--r--libavformat/libssh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 49e92e7516..9e3d4da45e 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;