Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7a7c57f authored by Tianjie Xu's avatar Tianjie Xu Committed by Automerger Merge Worker
Browse files

Merge "Handle the invalid timestamp in zipfile" am: 585ff019

Change-Id: I58518b92ec01aea0c5e0b585d58bfb7a7f1d9d64
parents 9edcf7cc 585ff019
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -48,9 +48,10 @@ struct ZipEntryCommon {
  // Modification time. The zipfile format specifies
  // that the first two little endian bytes contain the time
  // and the last two little endian bytes contain the date.
  // See `GetModificationTime`.
  // See `GetModificationTime`. Use signed integer to avoid the
  // sub-overflow.
  // TODO: should be overridden by extra time field, if present.
  uint32_t mod_time;
  int32_t mod_time;

  // Returns `mod_time` as a broken-down struct tm.
  struct tm GetModificationTime() const;
+1 −0
Original line number Diff line number Diff line
@@ -1570,6 +1570,7 @@ bool ZipArchive::InitializeCentralDirectory(off64_t cd_start_offset, size_t cd_s
  return true;
}

// This function returns the embedded timestamp as is; and doesn't perform validations.
tm ZipEntryCommon::GetModificationTime() const {
  tm t = {};