Skip to content

Commit 6321a19

Browse files
committed
Fixing a crash on overwrite request for files from gz, bz2 or xz archive (because such files have no date or size)
1 parent 948d1e4 commit 6321a19

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib7z/MLExtractCallbackWrapper.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// MLExtractCallbackWrapper.h
2-
// Copyright @ 2016-2020 MPL. All rights reserved.
2+
// Copyright @ 2016-2021 MPL. All rights reserved.
33

44
#include "StdAfx.h"
55
#include "MLExtractCallback.h"
@@ -35,13 +35,13 @@ MLExtractCallbackWrapper::AskOverwrite(
3535
Int32 *answer)
3636
{
3737
MT_LOCK
38-
UInt32 time1;
39-
UInt32 time2;
40-
NWindows::NTime::FileTimeToUnixTime(*x, time1);
41-
NWindows::NTime::FileTimeToUnixTime(*a, time2);
38+
UInt32 time1 = 0;
39+
UInt32 time2 = 0;
40+
if (x) NWindows::NTime::FileTimeToUnixTime(*x, time1);
41+
if (a) NWindows::NTime::FileTimeToUnixTime(*a, time2);
4242
time_t utime1 = time1;
4343
time_t utime2 = time2;
44-
return cb->AskOverwrite(existName, &utime1, y, newName, &utime2, b, answer);
44+
return cb->AskOverwrite(existName, x ? &utime1 : 0, y, newName, a ? &utime2 : 0, b, answer);
4545
}
4646

4747
STDMETHODIMP

0 commit comments

Comments
 (0)