-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/gd: checking imagescale/imagefilter invalid values. #14598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ext/gd/gd.c
Outdated
if (ZEND_SIZE_T_INT_OVFL(scatter_sub)) { | ||
zend_argument_value_error(3, "must not be greater than %d", INT_MAX); | ||
RETURN_THROWS(); | ||
} | ||
|
||
if (ZEND_SIZE_T_INT_OVFL(scatter_plus)) { | ||
zend_argument_value_error(4, "must not be greater than %d", INT_MAX); | ||
RETURN_THROWS(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also handle negative underflows? Or do the scatter arguments need to be greater than 0?
3d014f5
to
2e01b30
Compare
if (scatter_sub < 0 || ZEND_SIZE_T_INT_OVFL(scatter_sub)) { | ||
zend_argument_value_error(3, "must be between 0 and %d", INT_MAX); | ||
RETURN_THROWS(); | ||
} | ||
|
||
if (scatter_plus < 0 || ZEND_SIZE_T_INT_OVFL(scatter_plus)) { | ||
zend_argument_value_error(4, "must be between 0 and %d", INT_MAX); | ||
RETURN_THROWS(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test hitting those?
9f9ddfd
to
639256b
Compare
639256b
to
ffcf8c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, do not forget the UPGRADING entries
No description provided.