diff options
author | Kai Kang <kai.kang@windriver.com> | 2014-06-20 11:32:11 +0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2014-06-19 20:50:57 -0700 |
commit | bc360f8dbdf27bff07bb5db8d0ea9a7b10d8e3d1 (patch) | |
tree | ba14eb831d003b38bc8fb20243f216b90757c3dd | |
parent | 7798fdc99fc5f16a8a1f3f94bb2428908634d5a6 (diff) | |
download | syslinux-bc360f8dbdf27bff07bb5db8d0ea9a7b10d8e3d1.tar.gz syslinux-bc360f8dbdf27bff07bb5db8d0ea9a7b10d8e3d1.tar.xz syslinux-bc360f8dbdf27bff07bb5db8d0ea9a7b10d8e3d1.zip |
isohybrid: fix overflow on 32 bit system
When call isohybrid with option '-u', it overflows on a 32 bits host. It
seeks to 512 bytes before the end of the image to install gpt header. If
the size of image is larger than LONG_MAX, it overflows fseek() and
cause error:
isohybrid: image-x86-64-20140505110100.iso: seek error - 8: Invalid argument
Replace fseek with fseeko to fix this issue.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | utils/isohybrid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 410bb606..23fc6c0b 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -1126,7 +1126,7 @@ main(int argc, char *argv[]) * end of the image */ - if (fseek(fp, (isostat.st_size + padding) - orig_gpt_size - 512, + if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size - 512, SEEK_SET)) err(1, "%s: seek error - 8", argv[0]); |