From b6babc688d3d49ca32c3dbadfb2a4e32e9a43cdd Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 4 Oct 2019 21:13:31 +0200 Subject: Windows: Update libzip to version 1.5.2 --- src/Common/libzip/zip_dirent.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Common/libzip/zip_dirent.c') 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 @@ -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; } -- cgit v1.2.3