From: Colin Walters Date: Fri, 8 Oct 2021 13:07:41 +0000 (-0400) Subject: static-delta: Fix probably not actually possible NULL deref X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2^2~16^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f355482e1f82ee26ba0f202ff6c05b1b14ddc858;p=ostree.git 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. --- 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);