When updating a WIM in-place without modifying the lookup table, the new
XML data will spill into the old integrity table if the new XML data is
longer than the old XML data. Temporarily fix this by not using the old
integrity table in this case.
if (!(write_flags & WIMLIB_WRITE_FLAG_REUSE_INTEGRITY_TABLE))
old_lookup_table_end = 0;
+ if (wim->hdr.integrity_table_reshdr.offset_in_wim <
+ wim->hdr.xml_data_reshdr.offset_in_wim +
+ wim->hdr.xml_data_reshdr.size_in_wim)
+ {
+ /* Old integrity table was partially overwritten by the
+ * XML data. */
+ old_lookup_table_end = 0;
+ }
+
new_lookup_table_end = wim->hdr.lookup_table_reshdr.offset_in_wim +
wim->hdr.lookup_table_reshdr.size_in_wim;