diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-06-20 14:00:57 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-06-20 14:00:57 -0700 |
commit | 5b0d97899242fda7218db813bb2a8b9ebfbe4637 (patch) | |
tree | 24b6127245ad4f15e1bde8e53af067aa500ac5b0 | |
parent | a693d0be3a7b5678c26fcdecd8f4754c784875ac (diff) | |
download | syslinux-5b0d97899242fda7218db813bb2a8b9ebfbe4637.tar.gz |
fat: fix off-by-one error in the FAT installersyslinux-4.00-pre51
Fix off-by-one error in the FAT installer, which caused the install to
incorrectly abort without the patched version of the data.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | libinstaller/syslxmod.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libinstaller/syslxmod.c b/libinstaller/syslxmod.c index b96e127a..def4aaba 100644 --- a/libinstaller/syslxmod.c +++ b/libinstaller/syslxmod.c @@ -311,8 +311,8 @@ int syslinux_patch(const sector_t *sectp, int nsectors, int secptroffset; uint64_t *advptrs; - if (nsectors <= nsect) - return -1; + if (nsectors < nsect) + return -1; /* The actual file is too small for content */ /* Handle RAID mode, write proper bsSignature */ i = get_16(&sbs->bsSignature); @@ -325,7 +325,8 @@ int syslinux_patch(const sector_t *sectp, int nsectors, /* Search for LDLINUX_MAGIC to find the patch area */ for (wp = (uint32_t *)boot_image; get_32_sl(wp) != LDLINUX_MAGIC; - wp++) ; + wp++) + ; patcharea = (struct patch_area *)wp; /* Set up the totals */ |