VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_dirent.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-10-04 21:13:31 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-10-04 21:15:10 +0200
commitb6babc688d3d49ca32c3dbadfb2a4e32e9a43cdd (patch)
treed22d379c0786c9f870432cedc40da3c4a9c879ed /src/Common/libzip/zip_dirent.c
parent9a895bedde8ded1edbb814edb22a7197931a0d5b (diff)
downloadVeraCrypt-b6babc688d3d49ca32c3dbadfb2a4e32e9a43cdd.tar.gz
VeraCrypt-b6babc688d3d49ca32c3dbadfb2a4e32e9a43cdd.zip
Windows: Update libzip to version 1.5.2
Diffstat (limited to 'src/Common/libzip/zip_dirent.c')
-rw-r--r--src/Common/libzip/zip_dirent.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Common/libzip/zip_dirent.c b/src/Common/libzip/zip_dirent.c
index a6dbfac8..4dcb3391 100644
--- a/src/Common/libzip/zip_dirent.c
+++ b/src/Common/libzip/zip_dirent.c
@@ -1,6 +1,6 @@
/*
zip_dirent.c -- read directory entry (local or central), clean dirent
- Copyright (C) 1999-2017 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999-2019 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
@@ -1069,6 +1069,12 @@ _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) {
struct tm *tm;
tm = localtime(&intime);
+ if (tm == NULL) {
+ /* if localtime() fails, return an arbitrary date (1980-01-01 00:00:00) */
+ *ddate = (1 << 5) + 1;
+ *dtime = 0;
+ return;
+ }
if (tm->tm_year < 80) {
tm->tm_year = 80;
}