diff --git a/NEWS b/NEWS index bde353a2488..976f031effe 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS . Fixed bug GH-9918 (License information for xxHash is not included in README.REDIST.BINS file). (Akama Hitoshi) . Fixed bug GH-9650 (Can't initialize heap: [0x000001e7]). (Michael Voříšek) + . Fixed potentially undefined behavior in Windows ftok(3) emulation. (cmb) - MBString: . Fixed bug GH-9535 (The behavior of mb_strcut in mbstring has been changed in diff --git a/win32/ftok.c b/win32/ftok.c index 3a545375fa0..76e47ec48e1 100644 --- a/win32/ftok.c +++ b/win32/ftok.c @@ -51,7 +51,7 @@ ftok(const char *pathname, int proj_id) return (key_t)-1; } - ret = (key_t) ((proj_id & 0xff) << 24 | (st.st_dev & 0xff) << 16 | ((bhfi.nFileIndexLow | (__int64)bhfi.nFileIndexHigh << 32) & 0xffff)); + ret = (key_t) ((proj_id & 0xff) << 24 | (st.st_dev & 0xff) << 16 | (bhfi.nFileIndexLow & 0xffff)); CloseHandle(fh); PHP_WIN32_IOUTIL_CLEANUP_W()