Skip to content
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

ext/gd: checking imagescale/imagefilter invalid values. #14598

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

No description provided.

@devnexen devnexen marked this pull request as ready for review June 18, 2024 19:03
@devnexen devnexen requested a review from Girgias July 6, 2024 21:50
ext/gd/gd.c Outdated Show resolved Hide resolved
ext/gd/gd.c Outdated Show resolved Hide resolved
ext/gd/gd.c Outdated
Comment on lines 3648 to 3656
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();
}
Copy link
Member

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?

Comment on lines +3648 to +3656
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();
}
Copy link
Member

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?

@devnexen devnexen force-pushed the gd_more_of_checks branch 3 times, most recently from 9f9ddfd to 639256b Compare July 8, 2024 06:04
Copy link
Member

@Girgias Girgias left a 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

@devnexen devnexen closed this in 23a55ba Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants