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

Also reject negative format values in APCuIterator #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TysonAndre
Copy link
Contributor

This would affect applications that accidentally or deliberately pass in negative values for $format (e.g. PHP_INT_MIN on 64-bit builds)

	if (format > APC_ITER_ALL) { /* 0xffffffff */
		apc_error("APCUIterator format is invalid");
		return;
	}

@nikic
Copy link
Collaborator

nikic commented Nov 13, 2022

Doesn't looks that this error condition is tested currently, add one?

This would affect applications that accidentally or deliberately pass in
negative values for $format (e.g. PHP_INT_MIN on 64-bit builds)

The apc_error macro surprisingly calls php_verror, which is a fatal error.
Switch this to zend_throw_error instead - this still supports PHP 8.0 so
ValueError is too new.
@nikic
Copy link
Collaborator

nikic commented Nov 14, 2022

Looks like apc_099.phpt is failing.

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