Skip to content

Commit

Permalink
Fix #78282: atime and mtime mismatch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmb69 committed Jul 13, 2019
1 parent 1c1de0c commit bf242d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bf242d5

Please sign in to comment.