Skip to content

Commit 954543c

Browse files
committed
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 bf242d5)
1 parent f9f4a68 commit 954543c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ PHP NEWS
2626
- Standard:
2727
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
2828
with invalid length). (Nikita)
29+
. Fixed bug #78282 (atime and mtime mismatch). (cmb)
2930
. Fixed bug #78326 (improper memory deallocation on stream_get_contents()
3031
with fixed length buffer). (Albert Casademont)
3132

TSRM/tsrm_win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {
804804
// Note that LONGLONG is a 64-bit value
805805
LONGLONG ll;
806806

807-
ll = t * 10000000 + 116444736000000000;
807+
ll = t * 10000000LL + 116444736000000000LL;
808808
pft->dwLowDateTime = (DWORD)ll;
809809
pft->dwHighDateTime = ll >> 32;
810810
}

0 commit comments

Comments
 (0)