Skip to content

Commit

Permalink
Prevent segfault in boot_manager_remove_kernel_wrapper
Browse files Browse the repository at this point in the history
Similar to 6dad804 add a check for a
NULL kernel argument.

Signed-off-by: William Douglas <[email protected]>
  • Loading branch information
bryteise authored and bwarden committed Oct 11, 2024
1 parent 35d8d13 commit 86c739c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootman/bootman.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ bool boot_manager_remove_kernel_wrapper(BootManager *self, const Kernel *kernel)
CHECK_DBG_RET_VAL(!cbm_is_sysconfig_sane(self->sysconfig), false,
"Sysconfig is not sane");

CHECK_ERR_RET_VAL(!kernel, false, "No kernel specified, bailing");

/* Grab the available kernels */
kernels = boot_manager_get_kernels(self);
CHECK_ERR_RET_VAL(!kernels || kernels->len == 0, false,
Expand Down

0 comments on commit 86c739c

Please sign in to comment.