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

Fix oss-fuzz report triggered by GH-15712 commit. #15915

Open
wants to merge 1 commit into
base: PHP-8.2
Choose a base branch
from

Conversation

devnexen
Copy link
Member

It triggered allocation overflow which, even fixed, in turn gives memory leak on 32 bits but the allocator relies on signed integers so instead of changing j type we exit if an overflow during the buffer increase is going to happen.

It triggered allocation overflow which, even fixed, in turn gives memory
leak on 32 bits but the allocator relies on signed integers so instead
of changing `j` type we exit if an overflow during the buffer increase
is going to happen.
@cmb69
Copy link
Member

cmb69 commented Sep 16, 2024

Maybe we should constrain precision (and related) in the first place (and give users some hint):

php-src/main/main.c

Lines 289 to 298 in c7397f5

static PHP_INI_MH(OnSetPrecision)
{
zend_long i = ZEND_ATOL(ZSTR_VAL(new_value));
if (i >= -1) {
EG(precision) = i;
return SUCCESS;
} else {
return FAILURE;
}
}

I mean, even precision=100 makes no sense; you just get some made-up garbage (https://3v4l.org/eQinL).

@devnexen
Copy link
Member Author

devnexen commented Sep 16, 2024

for sure, but I was thinking it s behavior change, precision never was limited and I am targeting a stable branch. Thought it was more appropriate for master.

@cmb69
Copy link
Member

cmb69 commented Sep 16, 2024

Thought it was more appropriate for master.

Oh, absolutely. :)

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.

2 participants