Skip to content

Promote warnings to errors in str_pad() #4601

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

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 22, 2019

Split from #4554

return;
}

num_pad_chars = pad_length - ZSTR_LEN(input);
if (num_pad_chars >= INT_MAX) {
php_error_docref(NULL, E_WARNING, "Padding length is too long");
zend_throw_error(NULL, "Padding length is too long");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error condition looks bogus: I see no reason why the number of padding characters should be limited by INT_MAX. Could you submit a separate PR to drop this entirely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, maybe something due to before PHP could handle large strings ? (I remember reading something about 2GB string size limit)

@Girgias
Copy link
Member Author

Girgias commented Aug 24, 2019

Closed in favour of #4613 which was merged in as 9d18f23

@Girgias Girgias closed this Aug 24, 2019
@Girgias Girgias deleted the pad-str-warnings2error branch August 24, 2019 16:10
@Girgias Girgias restored the pad-str-warnings2error branch August 24, 2019 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants