We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa0c54d commit ffb3cb6Copy full SHA for ffb3cb6
ext/gd/gd.c
@@ -648,7 +648,7 @@ PHP_FUNCTION(imagesetstyle)
648
}
649
650
/* copy the style values in the stylearr */
651
- stylearr = safe_emalloc(num_styles, sizeof(int), 0);
+ stylearr = safe_emalloc(num_styles * sizeof(int), false);
652
653
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) {
654
stylearr[index++] = zval_get_long(item);
@@ -3599,7 +3599,7 @@ static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS)
3599
RETURN_BOOL(gdImageScatter(im, (int)scatter_sub, (int)scatter_plus));
3600
3601
3602
- colors = emalloc(num_colors * sizeof(int));
+ colors = safe_emalloc(num_colors * sizeof(int), false);
3603
3604
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(hash_colors), color) {
3605
*(colors + i++) = (int) zval_get_long(color);
0 commit comments