diff options
author | Simon Glass <sjg@chromium.org> | 2023-07-26 21:01:25 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-03 15:30:54 -0400 |
commit | 11158aef8939bb6e54361e4dae3809a9cbe78cff (patch) | |
tree | 9e95ad9c42383955460fc39eb095bcedb333b846 | |
parent | 2984d21a28f812c9c1fd2243cc72796f69a61585 (diff) | |
download | u-boot-WIP/2023-08-03-assorted-fixes.zip u-boot-WIP/2023-08-03-assorted-fixes.tar.gz u-boot-WIP/2023-08-03-assorted-fixes.tar.bz2 |
bootstd: Init the size before reading extlinux fileWIP/2023-08-03-assorted-fixes
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>
-rw-r--r-- | boot/bootmeth_pxe.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c index ce986bd..8d489a1 100644 --- a/boot/bootmeth_pxe.c +++ b/boot/bootmeth_pxe.c @@ -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) |