
From: Simon Glass <sjg@chromium.org> At present we require this environment variable in order to do any booting. The check for this actually later (the '"malloc fail' message) but there is a possible NULL access before getting to that point. Check it immediately after reading. Signed-off-by: Simon Glass <sjg@chromium.org> --- boot/pxe_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index f524b0a1dd3..97ab7ec3365 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -682,6 +682,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) } kernel_addr = env_get("kernel_addr_r"); + if (!kernel_addr) { + printf("No kernel_addr_r available for kernel\n"); + return 1; + } /* for FIT, append the configuration identifier */ if (label->config) { int len = strlen(kernel_addr) + strlen(label->config) + 1; -- 2.43.0