Skip to content

Commit bf242d5

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.
1 parent 1c1de0c commit bf242d5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ PHP NEWS
88
- Recode:
99
. Unbundled the recode extension. (cmb)
1010

11+
- Standard:
12+
. Fixed bug #78282 (atime and mtime mismatch). (cmb)
13+
1114
11 Jul 2019, PHP 7.4.0alpha3
1215

1316
- Core:

TSRM/tsrm_win32.c

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

772-
ll = t * 10000000 + 116444736000000000;
772+
ll = t * 10000000LL + 116444736000000000LL;
773773
pft->dwLowDateTime = (DWORD)ll;
774774
pft->dwHighDateTime = ll >> 32;
775775
}

0 commit comments

Comments
 (0)