]> granicus.if.org Git - php/commitdiff
Fix #78282: atime and mtime mismatch
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 13 Jul 2019 07:40:50 +0000 (09:40 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 6 Aug 2019 15:25:54 +0000 (17:25 +0200)
The fix for bug #78241 assumed that `time_t` would always be 64bit, but
actually is 32bit for x86.  We therefore enforce 64bit arithmetic to
avoid wrapping.

(cherry picked from commit bf242d58e77d50d4d8fdaaaca7ede686ec4467c0)

NEWS
TSRM/tsrm_win32.c

diff --git a/NEWS b/NEWS
index 31b67125f6cb093077127ef89fac7373e3c8acfc..a4e4793e857ad02dc2f68fdf7434d60f43888b74 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ PHP                                                                        NEWS
 - Standard:
   . Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
     with invalid length). (Nikita)
+  . Fixed bug #78282 (atime and mtime mismatch). (cmb)
   . Fixed bug #78326 (improper memory deallocation on stream_get_contents()
     with fixed length buffer). (Albert Casademont)
 
index 34b0676461168e3dc817583efbd54f7b858935e7..da9eaa2a7ac4d434f3827b4a98fbde2d6df2e346 100644 (file)
@@ -804,7 +804,7 @@ static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {
        // Note that LONGLONG is a 64-bit value
        LONGLONG ll;
 
-       ll = t * 10000000 + 116444736000000000;
+       ll = t * 10000000LL + 116444736000000000LL;
        pft->dwLowDateTime = (DWORD)ll;
        pft->dwHighDateTime = ll >> 32;
 }