diff options
author | Stanislav Malyshev <stas@php.net> | 2014-05-11 18:14:57 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-05-11 18:14:57 -0700 |
commit | 291b45afb5d5716ff0d340bd2bcb34731b806eed (patch) | |
tree | aba5d28e8c0d7d402f3e34076f9c95a6bb0f03e1 /ext/gd/gd.c | |
parent | cdd1c1122e1075cc45925ace7b2cd42559366a63 (diff) | |
download | php-git-291b45afb5d5716ff0d340bd2bcb34731b806eed.tar.gz |
Fix bug #67248 (imageaffinematrixget missing check of parameters)
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r-- | ext/gd/gd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 90a053535a..cbc7219e37 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5268,7 +5268,7 @@ PHP_FUNCTION(imageaffinematrixget) { double affine[6]; long type; - zval *options; + zval *options = NULL; zval **tmp; int res = GD_FALSE, i; @@ -5280,7 +5280,7 @@ PHP_FUNCTION(imageaffinematrixget) 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; } @@ -5327,6 +5327,10 @@ PHP_FUNCTION(imageaffinematrixget) 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); |