mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[image] Avoid claiming zero-length images as valid
Both the script and PXE images types will claim a zero-length image. Inhibit this to avoid end-user surprises.
This commit is contained in:
@@ -88,6 +88,12 @@ int pxe_load ( struct image *image ) {
|
||||
if ( filesz > ( 0xa0000 - 0x7c00 ) )
|
||||
return -ENOEXEC;
|
||||
|
||||
/* Rejecting zero-length images is also useful, since these
|
||||
* end up looking to the user like bugs in gPXE.
|
||||
*/
|
||||
if ( ! filesz )
|
||||
return -ENOEXEC;
|
||||
|
||||
/* There are no signature checks for PXE; we will accept anything */
|
||||
if ( ! image->type )
|
||||
image->type = &pxe_image_type;
|
||||
|
||||
Reference in New Issue
Block a user