From f355482e1f82ee26ba0f202ff6c05b1b14ddc858 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 8 Oct 2021 09:07:41 -0400 Subject: [PATCH] static-delta: Fix probably not actually possible NULL deref Flagged by `gcc -fanalyzer`. I didn't study this really deeply but I think it's not actually reachable. Anyways, let's catch it on general principle. --- src/ostree/ot-builtin-static-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c index ff31b574..0ce3cefb 100644 --- a/src/ostree/ot-builtin-static-delta.c +++ b/src/ostree/ot-builtin-static-delta.c @@ -669,7 +669,7 @@ ostree_builtin_static_delta (int argc, char **argv, OstreeCommandInvocation *inv return TRUE; /* Note early return */ } - if (!command->fn) + if (!command || !command->fn) { static_delta_usage (argv, TRUE); return glnx_throw (error, "Unknown \"static-delta\" subcommand '%s'", cmdname);