[syslinux:master] ISOLINUX: Fix checksum calculation in lzo/prepcore.c

syslinux-bot for Thomas Schmitt scdbackup at gmx.net
Fri Oct 26 03:27:04 PDT 2018


Commit-ID:  ac39cffd82d9f3ea4f243657c63db071ba8ef7b0
Gitweb:     http://www.syslinux.org/commit/ac39cffd82d9f3ea4f243657c63db071ba8ef7b0
Author:     Thomas Schmitt <scdbackup at gmx.net>
AuthorDate: Thu, 25 Oct 2018 06:13:04 -0400
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Thu, 25 Oct 2018 06:18:07 -0400

ISOLINUX: Fix checksum calculation in lzo/prepcore.c

The prescription for Boot Info Table says that checksumming begins
at byte 64 of isolinux.bin. When prepcore writes isolinux.bin it begins
copying bytes from the input file at the offset given by variable "start".
But it begins checksumming at offset 64 of the input file.
The problem exists since introduction of prepcore by release 4.00.
ISO 9660 programs usually fix it when they write the Boot Info Table.

Signed-off-by: Thomas Schmitt <scdbackup at gmx.net>

---
 lzo/prepcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lzo/prepcore.c b/lzo/prepcore.c
index 9147b2e4..b5ebe88b 100644
--- a/lzo/prepcore.c
+++ b/lzo/prepcore.c
@@ -331,7 +331,7 @@ int main(int argc, char *argv[])
 	unsigned int ptr;
 	outfile_len =
 	    ((offset - start + out_len + 2047) & ~2047) - (offset - start);
-	for (ptr = 64; ptr < offset; ptr += 4)
+	for (ptr = start + 64; ptr < offset; ptr += 4)
 	    csum += get_32((uint32_t *) (infile + ptr));
 	for (ptr = 0; ptr < outfile_len; ptr += 4)
 	    csum += get_32((uint32_t *) (out + ptr));


More information about the Syslinux-commits mailing list