[syslinux] fix crash when installing syslinux on large drives

* The check for minfatsize seems erroneous, and libfat_open()
  errors weren't checked in syslinux.c anyway
* Closes #156
This commit is contained in:
Pete Batard 2013-07-05 22:26:47 +01:00
parent d81ca7de24
commit 0938c56fdc
3 changed files with 13 additions and 6 deletions

View file

@ -146,7 +146,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter)
/* Reopen the volume (we already have a lock) */
d_handle = GetLogicalHandle(drive_index, TRUE, FALSE);
if (d_handle == INVALID_HANDLE_VALUE) {
uprintf("Could open volume for syslinux operation\n");
uprintf("Could open volume for Syslinux installation\n");
goto out;
}
@ -156,6 +156,10 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter)
if (sectors == NULL)
goto out;
fs = libfat_open(libfat_readfile, (intptr_t) d_handle);
if (fs == NULL) {
uprintf("FAT access error\n");
goto out;
}
ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", NULL);
secp = sectors;
nsectors = 0;