mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user