From 154765ae8ca53d94825134f3d454001ee06d4cea Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 20 Apr 2020 11:51:55 +0200 Subject: config: Check null deref As reported by LGTM Signed-off-by: Jakub Jelen Reviewed-by: Anderson Toshiyuki Sasaki --- src/config.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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; -- cgit v1.2.3