mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +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 */
|
/* TODO There should be more supported expansions */
|
||||||
cmd = ssh_path_expand_escape(session, command);
|
cmd = ssh_path_expand_escape(session, command);
|
||||||
|
if (cmd == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rv = ssh_exec_shell(cmd);
|
rv = ssh_exec_shell(cmd);
|
||||||
if (rv > 0 && negate == true) {
|
if (rv > 0 && negate == true) {
|
||||||
result = 1;
|
result = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user