Skip to content

Gh18902 - #18903

Closed
devnexen wants to merge 2 commits into
php:PHP-8.3from
devnexen:gh18902
Closed

Gh18902#18903
devnexen wants to merge 2 commits into
php:PHP-8.3from
devnexen:gh18902

Conversation

@devnexen

Copy link
Copy Markdown
Member

No description provided.

@devnexen
devnexen marked this pull request as ready for review June 22, 2025 08:16
@devnexen devnexen linked an issue Jun 22, 2025 that may be closed by this pull request

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nits, but LGTM and this can crash already so a ValueError is OK

Comment thread ext/ldap/ldap.c Outdated
}

if (ZSTR_LEN(reqoid) == 0) {
zend_argument_value_error(2, "cannot be empty");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And use the zend_argument_must_not_be_empty_error helper when merging up

Suggested change
zend_argument_value_error(2, "cannot be empty");
zend_argument_value_error(2, "must not be empty");

Comment thread ext/ldap/tests/gh18902.phpt Outdated
Comment on lines +8 to +12
try {
ldap_exop($conn,null);
} catch (\ValueError $e) {
echo $e->getMessage(), PHP_EOL;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove this case, as it is covered by the empty string one, and this reduces future churn when passing null becomes a TypeError.

@ndossche

Copy link
Copy Markdown
Member

I wonder whether there are more of these kinds of shenanigans in ext/ldap

@Girgias

Girgias commented Jun 22, 2025

Copy link
Copy Markdown
Member

I wonder whether there are more of these kinds of shenanigans in ext/ldap

Probably, considering earlier this cycle I found a bunch of NULL deref bugs just by staring at the code :|

@devnexen devnexen closed this in 2694eb9 Jun 22, 2025
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.

assertion failure ldap_extended_operation_s

3 participants