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.
This commit is contained in:
Vreixo Formoso 2008-08-29 20:54:14 +02:00
parent 33e058a66a
commit e79ee64a2f

View File

@ -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 */