]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Make sure argv is always set
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 10:58:46 +0000 (10:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Oct 2024 10:58:46 +0000 (10:58 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index b17ac7bfa5dd8777870230c36dbd7306b478946f..5b26e73a9267f69a5ad6b0e51ad36ab7d8f7b440 100644 (file)
@@ -1131,6 +1131,10 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe
                const char* argv[]) {
        int r;
 
+       // Check if we have received a command
+       if (!argv || !*argv)
+               return -EINVAL;
+
        // Redirect any logging to our log pipe
        pakfire_ctx_set_log_callback(jail->ctx, pakfire_jail_log_redirect, ctx);