From 86c739ceda5f23f951f0c74f16bfba43680d6fbd Mon Sep 17 00:00:00 2001 From: William Douglas Date: Fri, 11 Oct 2024 15:59:51 -0700 Subject: [PATCH] Prevent segfault in boot_manager_remove_kernel_wrapper Similar to 6dad804df0a496f1e3762daed5152ec21b7790ed add a check for a NULL kernel argument. Signed-off-by: William Douglas --- src/bootman/bootman.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootman/bootman.c b/src/bootman/bootman.c index d7dc990..8913045 100644 --- a/src/bootman/bootman.c +++ b/src/bootman/bootman.c @@ -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,