From 73a7d1f3f221e03a3c244a0fd91042c7b5bd8245 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 24 Oct 2015 15:38:04 -0500 Subject: [PATCH] write.c: correctly handle no existing blob table during overwrite --- src/write.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 " -- 2.43.0