config: Check null deref

As reported by LGTM

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This commit is contained in:
Jakub Jelen
2020-04-20 11:51:55 +02:00
parent 6417f5a3ca
commit 154765ae8c

View File

@@ -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;