mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-17 08:34:27 -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
|
@ -122,7 +122,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs_type)
|
|||
sectbuf = malloc(SECTOR_SIZE);
|
||||
if (sectbuf == NULL)
|
||||
goto out;
|
||||
|
||||
|
||||
/* Initialize the ADV -- this should be smarter */
|
||||
syslinux_reset_adv(syslinux_adv);
|
||||
|
||||
|
@ -262,7 +262,10 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs_type)
|
|||
}
|
||||
|
||||
/* Patch ldlinux.sys and the boot sector */
|
||||
syslinux_patch(sectors, nsectors, 0, 0, NULL, NULL);
|
||||
if (syslinux_patch(sectors, nsectors, 0, 0, NULL, NULL) < 0) {
|
||||
uprintf("Could not patch Syslinux files");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Rewrite the file */
|
||||
if (SetFilePointer(f_handle, 0, NULL, FILE_BEGIN) != 0 ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue