diff --git a/NEWS b/NEWS index d688ef5aad399..6a37ca9791c59 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,10 @@ PHP NEWS (ndossche) . Fixed bug #66095 (Hide libmagic dynamic symbols). (orlitzky) +- GD: + . imagesetstyle()/imagefilter()/imagecrop() check array argument entries + types. (David Carlier) + - Hash: . Upgrade xxHash to 0.8.2. (timwolla) diff --git a/UPGRADING b/UPGRADING index a97ad00061a27..a7c91c4501e9c 100644 --- a/UPGRADING +++ b/UPGRADING @@ -103,6 +103,11 @@ PHP 8.6 UPGRADE NOTES 5. Changed Functions ======================================== +- GD: + . imagesetstyle(), imagefilter() and imagecrop() filter their + array arguments types/values and raise a TypeError/ValueError + accordingly. + - mysqli: . The return structure of mysqli_get_charset() no longer contains the undocumented "comment" element. The value of "charsetnr" is diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 2624d13b51da9..ce2f74f6cdbd7 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -640,7 +640,20 @@ PHP_FUNCTION(imagesetstyle) stylearr = safe_emalloc(num_styles, sizeof(int), 0); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) { - stylearr[index++] = zval_get_long(item); + bool failed = false; + ZVAL_DEREF(item); + zend_long tmp = zval_try_get_long(item, &failed); + if (failed) { + efree(stylearr); + zend_argument_type_error(2, "must only have elements of type int, %s given", zend_zval_type_name(item)); + RETURN_THROWS(); + } + if (ZEND_LONG_EXCEEDS_INT(tmp)) { + efree(stylearr); + zend_argument_value_error(2, "elements must be between %d and %d", INT_MIN, INT_MAX); + RETURN_THROWS(); + } + stylearr[index++] = (int) tmp; } ZEND_HASH_FOREACH_END(); gdImageSetStyle(im, stylearr, index); @@ -3595,7 +3608,20 @@ static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS) colors = safe_emalloc(num_colors, sizeof(int), 0); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(hash_colors), color) { - *(colors + i++) = (int) zval_get_long(color); + bool failed = false; + ZVAL_DEREF(color); + zend_long tmp = zval_try_get_long(color, &failed); + if (failed) { + efree(colors); + zend_argument_type_error(5, "must be of type int, %s given", zend_zval_type_name(color)); + RETURN_THROWS(); + } + if (tmp < 0 || ZEND_LONG_INT_OVFL(tmp)) { + efree(colors); + zend_argument_value_error(5, "value must be between 0 and %d", INT_MAX); + RETURN_THROWS(); + } + colors[i++] = (int) tmp; } ZEND_HASH_FOREACH_END(); RETVAL_BOOL(gdImageScatterColor(im, (int)scatter_sub, (int)scatter_plus, colors, num_colors)); @@ -3763,6 +3789,23 @@ PHP_FUNCTION(imageantialias) } /* }}} */ +static bool php_gd_zval_try_get_c_int(zval *tmp, const char *field, int *res) { + zend_long r; + bool failed = false; + ZVAL_DEREF(tmp); + r = zval_try_get_long(tmp, &failed); + if (failed) { + zend_argument_type_error(2, "\"%s\" key must be of type int, %s given", field, zend_zval_type_name(tmp)); + return false; + } + if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(r))) { + zend_argument_value_error(2, "\"%s\" key must be between %d and %d", field, INT_MIN, INT_MAX); + return false; + } + *res = (int)r; + return true; +} + /* {{{ Crop an image using the given coordinates and size, x, y, width and height. */ PHP_FUNCTION(imagecrop) { @@ -3781,28 +3824,36 @@ PHP_FUNCTION(imagecrop) im = php_gd_libgdimageptr_from_zval_p(IM); if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") -1)) != NULL) { - rect.x = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "x", &rect.x)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have an \"x\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) { - rect.y = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "y", &rect.y)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"y\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) { - rect.width = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "width", &rect.width)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"width\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) { - rect.height = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "height", &rect.height)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"height\" key"); RETURN_THROWS(); diff --git a/ext/gd/tests/bug66356.phpt b/ext/gd/tests/bug66356.phpt index b65fb54f57184..616a270115c14 100644 --- a/ext/gd/tests/bug66356.phpt +++ b/ext/gd/tests/bug66356.phpt @@ -7,10 +7,14 @@ gd $img = imagecreatetruecolor(10, 10); // POC #1 -var_dump(imagecrop($img, array("x" => "a", "y" => 0, "width" => 10, "height" => 10))); +var_dump(imagecrop($img, array("x" => 0, "y" => 0, "width" => 10, "height" => 10))); -$arr = array("x" => "a", "y" => "12b", "width" => 10, "height" => 10); -var_dump(imagecrop($img, $arr)); +$arr = array("x" => 2147483647, "y" => 2147483647, "width" => 10, "height" => 10); +try { + imagecrop($img, $arr); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} print_r($arr); // POC #2 @@ -28,12 +32,11 @@ var_dump(imagecrop($img, array("x" => 0, "y" => 0, "width" => 65535, "height" => --EXPECTF-- object(GdImage)#2 (0) { } -object(GdImage)#2 (0) { -} +imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys Array ( - [x] => a - [y] => 12b + [x] => 2147483647 + [y] => 2147483647 [width] => 10 [height] => 10 ) @@ -41,9 +44,9 @@ Array Warning: imagecrop(): %cne parameter to a memory allocation multiplication is negative or zero, failing operation gracefully in %s on line %d bool(false) -object(GdImage)#2 (0) { +object(GdImage)#3 (0) { } -object(GdImage)#2 (0) { +object(GdImage)#3 (0) { } Warning: imagecrop(): %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully diff --git a/ext/gd/tests/gh18005.phpt b/ext/gd/tests/gh18005.phpt new file mode 100644 index 0000000000000..5282c0be0268a --- /dev/null +++ b/ext/gd/tests/gh18005.phpt @@ -0,0 +1,92 @@ +--TEST-- +GH-18005: imagesetstyle, imagefilter, imagecrop array values type checks +--EXTENSIONS-- +gd +--SKIPIF-- + +--FILE-- +getMessage() . PHP_EOL; +} +try { + imagesetstyle($img, [0, PHP_INT_MIN]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [new A()]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [-1]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => PHP_INT_MIN, "y" => 0, "width" => 0, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => PHP_INT_MIN, "width" => 0, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => PHP_INT_MAX, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => PHP_INT_MAX]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +try { + imagecrop($img, ["x" => new A(), "y" => 0, "width" => 0, "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => new A(), "width" => 0, "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => new A(), "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => new A()]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} + +$one = 1; +var_dump(imagecrop($img, ["x" => &$one, "y" => &$one, "width" => &$one, "height" => &$one])); +?> +--EXPECTF-- +imagesetstyle(): Argument #2 ($style) must only have elements of type int, A given +imagesetstyle(): Argument #2 ($style) elements must be between %i and %d +imagefilter(): Argument #5 must be of type int, A given +imagefilter(): Argument #5 value must be between 0 and 2147483647 +imagecrop(): Argument #2 ($rectangle) "x" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "y" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "width" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "height" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "x" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "y" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "width" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "height" key must be of type int, A given +object(GdImage)#2 (0) { +} diff --git a/ext/pcntl/config.m4 b/ext/pcntl/config.m4 index cfe6e80ca1103..553419114fd25 100644 --- a/ext/pcntl/config.m4 +++ b/ext/pcntl/config.m4 @@ -68,9 +68,6 @@ int main(void) { [AC_DEFINE([HAVE_SCHED_GETCPU], [1], [Define to 1 if the 'sched_getcpu' function is properly supported.])]) - AC_CHECK_TYPE([siginfo_t], [PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"],, - [#include ]) - PHP_NEW_EXTENSION([pcntl], [pcntl.c php_signal.c], [$ext_shared], diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index ab7b149920808..b4e21e55b6e88 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -185,12 +185,8 @@ ZEND_GET_MODULE(pcntl) static void (*orig_interrupt_function)(zend_execute_data *execute_data); -#ifdef HAVE_STRUCT_SIGINFO_T static void pcntl_signal_handler(int, siginfo_t*, void*); static void pcntl_siginfo_to_zval(int, siginfo_t*, zval*); -#else -static void pcntl_signal_handler(int); -#endif static void pcntl_signal_dispatch(void); static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer); static void pcntl_interrupt_function(zend_execute_data *execute_data); @@ -240,7 +236,7 @@ PHP_RSHUTDOWN_FUNCTION(pcntl) /* Reset all signals to their default disposition */ ZEND_HASH_FOREACH_NUM_KEY_VAL(&PCNTL_G(php_signal_table), signo, handle) { if (Z_TYPE_P(handle) != IS_LONG || Z_LVAL_P(handle) != (zend_long)SIG_DFL) { - php_signal(signo, (Sigfunc *)(zend_long)SIG_DFL, 0); + php_signal(signo, (Sigfunc *)(zend_long)SIG_DFL, false); } } ZEND_HASH_FOREACH_END(); @@ -835,7 +831,7 @@ PHP_FUNCTION(pcntl_signal) zend_argument_value_error(2, "must be either SIG_DFL or SIG_IGN when an integer value is given"); RETURN_THROWS(); } - if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == (void *)SIG_ERR) { + if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), restart_syscalls) == (void *)SIG_ERR) { PCNTL_G(last_error) = errno; php_error_docref(NULL, E_WARNING, "Error assigning signal"); RETURN_FALSE; @@ -1007,8 +1003,7 @@ PHP_FUNCTION(pcntl_sigprocmask) /* }}} */ #endif -#ifdef HAVE_STRUCT_SIGINFO_T -# ifdef HAVE_SIGWAITINFO +#ifdef HAVE_SIGWAITINFO /* {{{ Synchronously wait for queued signals */ PHP_FUNCTION(pcntl_sigwaitinfo) @@ -1050,8 +1045,9 @@ PHP_FUNCTION(pcntl_sigwaitinfo) RETURN_LONG(signal_no); } /* }}} */ -# endif -# ifdef HAVE_SIGTIMEDWAIT +#endif + +#ifdef HAVE_SIGTIMEDWAIT /* {{{ Wait for queued signals */ PHP_FUNCTION(pcntl_sigtimedwait) { @@ -1113,7 +1109,7 @@ PHP_FUNCTION(pcntl_sigtimedwait) RETURN_LONG(signal_no); } /* }}} */ -# endif +#endif static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_siginfo) /* {{{ */ { @@ -1183,7 +1179,6 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi } } /* }}} */ -#endif #ifdef HAVE_GETPRIORITY /* {{{ Get the priority of any process */ @@ -1325,11 +1320,7 @@ PHP_FUNCTION(pcntl_strerror) /* }}} */ /* Our custom signal handler that calls the appropriate php_function */ -#ifdef HAVE_STRUCT_SIGINFO_T static void pcntl_signal_handler(int signo, siginfo_t *siginfo, void *context) -#else -static void pcntl_signal_handler(int signo) -#endif { struct php_pcntl_pending_signal *psig = PCNTL_G(spares); if (!psig) { @@ -1341,9 +1332,7 @@ static void pcntl_signal_handler(int signo) psig->signo = signo; psig->next = NULL; -#ifdef HAVE_STRUCT_SIGINFO_T psig->siginfo = *siginfo; -#endif /* the head check is important, as the tick handler cannot atomically clear both * the head and tail */ @@ -1395,19 +1384,14 @@ void pcntl_signal_dispatch(void) if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) { if (Z_TYPE_P(handle) != IS_LONG) { ZVAL_LONG(¶ms[0], queue->signo); -#ifdef HAVE_STRUCT_SIGINFO_T array_init(¶ms[1]); pcntl_siginfo_to_zval(queue->signo, &queue->siginfo, ¶ms[1]); -#else - ZVAL_NULL(¶ms[1]); -#endif /* Call php signal handler - Note that we do not report errors, and we ignore the return value */ call_user_function(NULL, NULL, handle, &retval, 2, params); zval_ptr_dtor(&retval); -#ifdef HAVE_STRUCT_SIGINFO_T zval_ptr_dtor(¶ms[1]); -#endif + if (EG(exception)) { break; } diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 2da540fa71ecc..4a4b8fe869317 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -1035,14 +1035,12 @@ function pcntl_signal_dispatch(): bool {} function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {} #endif -#ifdef HAVE_STRUCT_SIGINFO_T #if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) /** @param array $info */ function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {} /** @param array $info */ function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} -#endif #endif function pcntl_wifexited(int $status): bool {} diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index d9624a2260575..2da7c8ad5db88 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit pcntl.stub.php instead. - * Stub hash: dfa1e84a14e1926a50a42919e24ada58348fe4d9 + * Stub hash: 04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0) @@ -49,7 +49,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_sigprocmask, 0, 2, _IS_BOO ZEND_END_ARG_INFO() #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigwaitinfo, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, signals, IS_ARRAY, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]") @@ -185,7 +185,7 @@ ZEND_FUNCTION(pcntl_signal_dispatch); #if defined(HAVE_SIGPROCMASK) ZEND_FUNCTION(pcntl_sigprocmask); #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_FUNCTION(pcntl_sigwaitinfo); ZEND_FUNCTION(pcntl_sigtimedwait); #endif @@ -246,7 +246,7 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_SIGPROCMASK) ZEND_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask) #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo) ZEND_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait) #endif diff --git a/ext/pcntl/pcntl_decl.h b/ext/pcntl/pcntl_decl.h index 1059485bc9342..7f8e5172cedb7 100644 --- a/ext/pcntl/pcntl_decl.h +++ b/ext/pcntl/pcntl_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit pcntl.stub.php instead. - * Stub hash: dfa1e84a14e1926a50a42919e24ada58348fe4d9 */ + * Stub hash: 04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826 */ -#ifndef ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H -#define ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H +#ifndef ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H +#define ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H typedef enum zend_enum_Pcntl_QosClass { ZEND_ENUM_Pcntl_QosClass_UserInteractive = 1, @@ -12,4 +12,4 @@ typedef enum zend_enum_Pcntl_QosClass { ZEND_ENUM_Pcntl_QosClass_Background = 5, } zend_enum_Pcntl_QosClass; -#endif /* ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H */ +#endif /* ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H */ diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index e02f93246e881..aed96af380e21 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -38,9 +38,7 @@ PHP_MINFO_FUNCTION(pcntl); struct php_pcntl_pending_signal { struct php_pcntl_pending_signal *next; zend_long signo; -#ifdef HAVE_STRUCT_SIGINFO_T siginfo_t siginfo; -#endif }; ZEND_BEGIN_MODULE_GLOBALS(pcntl) diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 14c169310e601..7f27ac33e45d4 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -21,24 +21,18 @@ /* php_signal using sigaction is derived from Advanced Programming * in the Unix Environment by W. Richard Stevens p 298. */ -Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) +Sigfunc *php_signal4(int signo, Sigfunc *func, bool restart, bool mask_all) { struct sigaction act,oact; -#ifdef HAVE_STRUCT_SIGINFO_T act.sa_sigaction = func; -#else - act.sa_handler = func; -#endif if (mask_all) { sigfillset(&act.sa_mask); } else { sigemptyset(&act.sa_mask); } act.sa_flags = SA_ONSTACK; -#ifdef HAVE_STRUCT_SIGINFO_T act.sa_flags |= SA_SIGINFO; -#endif if (!restart) { #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS */ @@ -50,14 +44,10 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) } zend_sigaction(signo, &act, &oact); -#ifdef HAVE_STRUCT_SIGINFO_T return oact.sa_sigaction; -#else - return oact.sa_handler; -#endif } -Sigfunc *php_signal(int signo, Sigfunc *func, int restart) +Sigfunc *php_signal(int signo, Sigfunc *func, bool restart) { - return php_signal4(signo, func, restart, 0); + return php_signal4(signo, func, restart, false); } diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h index 256898e70acbc..44cbd68999f10 100644 --- a/ext/pcntl/php_signal.h +++ b/ext/pcntl/php_signal.h @@ -18,12 +18,9 @@ #ifndef PHP_SIGNAL_H #define PHP_SIGNAL_H -#ifdef HAVE_STRUCT_SIGINFO_T typedef void Sigfunc(int, siginfo_t*, void*); -#else -typedef void Sigfunc(int); -#endif -Sigfunc *php_signal(int signo, Sigfunc *func, int restart); -Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all); + +Sigfunc *php_signal(int signo, Sigfunc *func, bool restart); +Sigfunc *php_signal4(int signo, Sigfunc *func, bool restart, bool mask_all); #endif diff --git a/gcovr.cfg b/gcovr.cfg index a8267cd6e0003..7ee4cff356e8f 100644 --- a/gcovr.cfg +++ b/gcovr.cfg @@ -13,7 +13,11 @@ exclude = ext/mbstring/libmbfl/.* exclude = ext/opcache/jit/ir/.* exclude = ext/pcre/pcre2lib/.* exclude = ext/uri/uriparser/.* +exclude = Zend/Optimizer/ssa_integrity\.c +exclude = Zend/Optimizer/zend_dump\.c # These patterns have implicit ^/$ anchors. exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).* exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s* +exclude-lines-by-pattern = \s*if \(ctx->debug_level & ZEND_DUMP_\w+\) \{\s* +exclude-lines-by-pattern = \s*zend_dump_op_array\(.*\);\s*