Skip to contentSkip to conversation

fix libfsimage integer overflow

PATCH New John Levon 1 participant 1 message Nov 10, 2006

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 fix libfsimage integer overflow

# HG changeset patch
# User [email protected]
# Date 1163194188 28800
# Node ID 7c295303f07f0b80859b8d315e4122f1c44c24fb # Parent b11aa80b24f3300f4f6c04db1621159def33d44c Fix integer overflow problem with libfsimage grub plugins.

tools/libfsimage/common/fsimage_grub.c +1 -1
@@ -126,7 +126,7 @@ fsig_devread(fsi_file_t *ffi, unsigned i
 fsig_devread(fsi_file_t *ffi, unsigned int sector, unsigned int offset,
     unsigned int bufsize, char *buf)
 {
-	uint64_t off = ffi->ff_fsi->f_off + ((uint64_t)(sector * 512)) + offset;
+	uint64_t off = ffi->ff_fsi->f_off + ((uint64_t)sector * 512) + offset;
 	ssize_t bytes_read = 0;
 
 	while (bufsize) {