aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-20 14:00:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-20 14:00:57 -0700
commit5b0d97899242fda7218db813bb2a8b9ebfbe4637 (patch)
tree24b6127245ad4f15e1bde8e53af067aa500ac5b0 /libinstaller
parenta693d0be3a7b5678c26fcdecd8f4754c784875ac (diff)
downloadsyslinux-5b0d97899242fda7218db813bb2a8b9ebfbe4637.tar.gz
syslinux-5b0d97899242fda7218db813bb2a8b9ebfbe4637.tar.xz
syslinux-5b0d97899242fda7218db813bb2a8b9ebfbe4637.zip
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>
Diffstat (limited to 'libinstaller')
-rw-r--r--libinstaller/syslxmod.c7
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 */