aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-04-20 11:51:55 +0200
committerJakub Jelen <jjelen@redhat.com>2020-04-20 14:14:33 +0200
commit154765ae8ca53d94825134f3d454001ee06d4cea (patch)
treee30303d3ebc7593702ee39b9ed665a0e4b4b9c10 /src/config.c
parent6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4 (diff)
downloadlibssh-154765ae8ca53d94825134f3d454001ee06d4cea.tar.gz
libssh-154765ae8ca53d94825134f3d454001ee06d4cea.tar.xz
libssh-154765ae8ca53d94825134f3d454001ee06d4cea.zip
config: Check null deref
As reported by LGTM Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 161985ef..79a64339 100644
--- a/src/config.c
+++ b/src/config.c
@@ -400,6 +400,9 @@ ssh_match_exec(ssh_session session, const char *command, bool negate)
/* TODO There should be more supported expansions */
cmd = ssh_path_expand_escape(session, command);
+ if (cmd == NULL) {
+ return 0;
+ }
rv = ssh_exec_shell(cmd);
if (rv > 0 && negate == true) {
result = 1;