mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04:00
[syslinux] fix a crash if the downloaded Syslinux content has been modified
* Some stupid corporate firewalls will return garbage content for ldlinux.bss/ldlinux.sys instead of a 403 (as they really should), which creates an issue with the code written by the Syslinux people, as they forgot to check for potential overflows...
This commit is contained in:
parent
c12977a164
commit
ad68ccfac9
3 changed files with 13 additions and 8 deletions
|
@ -123,9 +123,11 @@ int syslinux_patch(const sector_t *sectp, int nsectors,
|
|||
|
||||
/* Search for LDLINUX_MAGIC to find the patch area */
|
||||
for (wp = (const uint32_t _slimg *)boot_image;
|
||||
get_32_sl(wp) != LDLINUX_MAGIC;
|
||||
(get_32_sl(wp) != LDLINUX_MAGIC) && (((uintptr_t)wp) < ((uintptr_t)boot_image + boot_image_len));
|
||||
wp++)
|
||||
;
|
||||
if (((uintptr_t)wp) >= ((uintptr_t)boot_image + boot_image_len))
|
||||
return -1;
|
||||
patcharea = (struct patch_area _slimg *)wp;
|
||||
epa = slptr(boot_image, &patcharea->epaoffset);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue