]> 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>
Sat, 13 Jul 2019 07:44:46 +0000 (09:44 +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.

NEWS
TSRM/tsrm_win32.c

diff --git a/NEWS b/NEWS
index 72451dbc1efd6ae37771308d8846cd20749a5764..541f16ea5538049c333a6e5b70d5b12d68e17895 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ PHP                                                                        NEWS
 - Recode:
   . Unbundled the recode extension. (cmb)
 
+- Standard:
+  . Fixed bug #78282 (atime and mtime mismatch). (cmb)
+
 11 Jul 2019, PHP 7.4.0alpha3
 
 - Core:
index e510c61426875ab7812a0c17d4cd6726c1cde778..e16c94613110ec785248e8a7026ac738bf14fd5e 100644 (file)
@@ -769,7 +769,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;
 }