summaryrefslogtreecommitdiffstats
path: root/Source/cmArchiveWrite.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-08-20 15:23:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-08-20 15:23:20 (GMT)
commit20fec1520458cdfb71bf1099cfc3648154d57d8f (patch)
tree2597bc6fb97dfbe86cdc41bd8efa7b0c97d2aebf /Source/cmArchiveWrite.cxx
parente2c06736e54d9160e49d5a67f5c10ca601ab31ed (diff)
downloadCMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.zip
CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.gz
CMake-20fec1520458cdfb71bf1099cfc3648154d57d8f.tar.bz2
cmArchiveWrite: Check for construction errors on Open
Also update call sites to report the error. Issue: #19666
Diffstat (limited to 'Source/cmArchiveWrite.cxx')
-rw-r--r--Source/cmArchiveWrite.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 54b2998..9e0d80c 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -250,6 +250,9 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
bool cmArchiveWrite::Open()
{
+ if (!this->Error.empty()) {
+ return false;
+ }
if (archive_write_open(
this->Archive, this, nullptr,
reinterpret_cast<archive_write_callback*>(&Callback::Write),