]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstd: Init the size before reading extlinux file
authorSimon Glass <sjg@chromium.org>
Thu, 27 Jul 2023 03:01:25 +0000 (21:01 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 3 Aug 2023 19:30:54 +0000 (15:30 -0400)
The implementation in extlinux_pxe_getfile() does not pass a valid size
to bootmeth_read_file(), so this can fail if the uninited value happens to
be too small.

Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootmeth_pxe.c

index ce986bd260d119c10d1f1b47d9b05c3abfb09fe1..8d489a11aa404eade250b6231a86e84357c7faad 100644 (file)
@@ -31,6 +31,9 @@ static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path,
        int ret;
 
        addr = simple_strtoul(file_addr, NULL, 16);
+
+       /* Allow up to 1GB */
+       *sizep = 1 << 30;
        ret = bootmeth_read_file(info->dev, info->bflow, file_path, addr,
                                 sizep);
        if (ret)