From: Eric Biggers Date: Sat, 24 Oct 2015 20:38:04 +0000 (-0500) Subject: write.c: correctly handle no existing blob table during overwrite X-Git-Tag: v1.8.3~25 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=73a7d1f3f221e03a3c244a0fd91042c7b5bd8245 write.c: correctly handle no existing blob table during overwrite --- diff --git a/src/write.c b/src/write.c index 930c61b1..f3308a24 100644 --- a/src/write.c +++ b/src/write.c @@ -3110,8 +3110,11 @@ overwrite_wim_inplace(WIMStruct *wim, int write_flags, unsigned num_threads) * this data would be overwritten. */ old_xml_begin = wim->hdr.xml_data_reshdr.offset_in_wim; old_xml_end = old_xml_begin + wim->hdr.xml_data_reshdr.size_in_wim; - old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + - wim->hdr.blob_table_reshdr.size_in_wim; + if (wim->hdr.blob_table_reshdr.offset_in_wim == 0) + old_blob_table_end = WIM_HEADER_DISK_SIZE; + else + old_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim + + wim->hdr.blob_table_reshdr.size_in_wim; if (wim_has_integrity_table(wim) && wim->hdr.integrity_table_reshdr.offset_in_wim < old_xml_end) { WARNING("Didn't expect the integrity table to be "