-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Description
Description
There is a potential security issue when converting clock_t
to zend_long
that could lead to unpredictable results on different platforms. Platform dependencies of clock_t
size: The size of clock_t
is not fixed by the C standard, and may differ between systems (32-bit and 64-bit). Sign extension: If clock_t
is smaller than zend_long
, and clock_t
is a signed type, then sign extension may occur when converting to zend_long
, leading to incorrect interpretation of the values.
Lines 386 to 390 in 28a083b
add_assoc_long(return_value, "ticks", ticks); /* clock ticks */ | |
add_assoc_long(return_value, "utime", t.tms_utime); /* user time */ | |
add_assoc_long(return_value, "stime", t.tms_stime); /* system time */ | |
add_assoc_long(return_value, "cutime", t.tms_cutime); /* user time of children */ | |
add_assoc_long(return_value, "cstime", t.tms_cstime); /* system time of children */ |
Found using SVACE
Author D. Chizhmak
PHP Version
PHP 8.3+
Operating System
No response