From: Simon Glass Date: Fri, 15 Nov 2024 23:19:18 +0000 (-0700) Subject: bootmeth_efi: Check the filename-allocation in the network path X-Git-Tag: v2025.04-rc1~55^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea7f88f313270e2bfef5f4f91dfb34f86f90c675;p=pandora-u-boot.git bootmeth_efi: Check the filename-allocation in the network path If the filename cannot be set we should give up. Add the missing error check. Signed-off-by: Simon Glass --- diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index f711b9d0598..a2998452666 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -252,6 +252,8 @@ static int distro_efi_read_bootflow_net(struct bootflow *bflow) if (!bootfile_name) return log_msg_ret("bootfile_name", ret); bflow->fname = strdup(bootfile_name); + if (!bflow->fname) + return log_msg_ret("fi0", -ENOMEM); /* do the hideous EFI hack */ efi_set_bootdev("Net", "", bflow->fname, map_sysmem(addr, 0),