[syslinux] [PATCH] isohybrid: fix overflow on 32 bit system

Kai Kang kai.kang at windriver.com
Thu Jun 19 20:32:11 PDT 2014


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 at windriver.com>
---
 utils/isohybrid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index 410bb60..23fc6c0 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]);
 
-- 
1.9.1



More information about the Syslinux mailing list