From e79ee64a2f8d4a1cbe3b6510cdacbb9814c03db1 Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Fri, 29 Aug 2008 20:54:14 +0200 Subject: [PATCH] Fix bug #140, related to isolinux size, following patch by Christian Ostheimer. We had assumed isolinux images are always a multiple of 4 bytes. However, this does not happens with recent isolinux images. --- libisofs/eltorito.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libisofs/eltorito.c b/libisofs/eltorito.c index 94bdbc4..860cf25 100644 --- a/libisofs/eltorito.c +++ b/libisofs/eltorito.c @@ -807,9 +807,12 @@ int patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize) offset += 4; } if (offset != imgsize) { - /* file length not multiple of 4 */ - return iso_msg_submit(t->image->id, ISO_ISOLINUX_CANT_PATCH, 0, - "Unexpected isolinux image length. Patch might not work."); + /* + * file length not multiple of 4 + * empty space in isofs is padded with zero; + * assume same for last dword + */ + checksum += iso_read_lsb(buf + offset, imgsize - offset); } /* patch boot info table */