-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Gh18902 #18903
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
Gh18902 #18903
Conversation
There was a problem hiding this comment.
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
ext/ldap/ldap.c
Outdated
} | ||
|
||
if (ZSTR_LEN(reqoid) == 0) { | ||
zend_argument_value_error(2, "cannot be empty"); |
There was a problem hiding this comment.
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
zend_argument_value_error(2, "cannot be empty"); | |
zend_argument_value_error(2, "must not be empty"); |
ext/ldap/tests/gh18902.phpt
Outdated
try { | ||
ldap_exop($conn,null); | ||
} catch (\ValueError $e) { | ||
echo $e->getMessage(), PHP_EOL; | ||
} |
There was a problem hiding this comment.
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.
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 :| |
No description provided.