summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-07-13 09:40:50 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-08-06 17:25:54 +0200
commit954543cec629c3c5d42c2d62228dd68604bb6b19 (patch)
tree7a75e2e2940a8897174ee8c875d115c26eff3aa9
parentf9f4a68368406a2ba2bd9fab0494261090183e8e (diff)
downloadphp-git-954543cec629c3c5d42c2d62228dd68604bb6b19.tar.gz
Fix #78282: atime and mtime mismatch
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)
-rw-r--r--NEWS1
-rw-r--r--TSRM/tsrm_win32.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 31b67125f6..a4e4793e85 100644
--- 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)
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 34b0676461..da9eaa2a7a 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -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;
}