From 35a448862fb198323481044e0d820c7c631e4dab Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 24 Oct 2015 14:31:24 -0500 Subject: [PATCH] write.c: don't write integrity table if there is no blob table The following commands would produce an invalid integrity table: wimcapture empty empty.wim wimdelete delete empty.wim 1 --check --- src/write.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/write.c b/src/write.c index bc7b6ebd..9e396162 100644 --- a/src/write.c +++ b/src/write.c @@ -2388,7 +2388,9 @@ finish_write(WIMStruct *wim, int image, int write_flags, } /* Write integrity table if needed. */ - if (write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) { + if ((write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) && + wim->out_hdr.blob_table_reshdr.offset_in_wim != 0) + { if (write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS) { /* The XML data we wrote may have overwritten part of * the old integrity table, so while calculating the new -- 2.43.0