. Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
(Julio Pintos)
+- GD:
+ . Fixed bug #67248 (imageaffinematrixget missing check of parameters). (Stas)
+
- PCRE:
. Fixed bug #67238 (Ungreedy and min/max quantifier bug, applied patch
from the upstream). (Anatol)
{
double affine[6];
long type;
- zval *options;
+ zval *options = NULL;
zval **tmp;
int res = GD_FALSE, i;
case GD_AFFINE_TRANSLATE:
case GD_AFFINE_SCALE: {
double x, y;
- if (Z_TYPE_P(options) != IS_ARRAY) {
+ if (!options || Z_TYPE_P(options) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array expected as options");
RETURN_FALSE;
}
case GD_AFFINE_SHEAR_VERTICAL: {
double angle;
+ if (!options) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
+ RETURN_FALSE;
+ }
convert_to_double_ex(&options);
angle = Z_DVAL_P(options);
--- /dev/null
+--TEST--
+Bug #67248 (imageaffinematrixget missing check of parameters)
+--SKIPIF--
+<?php
+ if(!extension_loaded('gd')){ die('skip gd extension not available')}
+ if(!function_exists('imageaffinematrixget')) die('skip imageaffinematrixget() not available');
+?>
+--FILE--
+<?php
+for($i=0;$i<7;$i++) {
+ imageaffinematrixget($i);
+}
+?>
+--EXPECTF--
+Warning: imageaffinematrixget(): Array expected as options in %s on line %d
+
+Warning: imageaffinematrixget(): Array expected as options in %s on line %d
+
+Warning: imageaffinematrixget(): Number is expected as option in %s on line %d
+
+Warning: imageaffinematrixget(): Number is expected as option in %s on line %d
+
+Warning: imageaffinematrixget(): Number is expected as option in %s on line %d
+
+Warning: imageaffinematrixget(): Invalid type for element 5 in %s on line %d
+
+Warning: imageaffinematrixget(): Invalid type for element 6 in %s on line %d