-
Notifications
You must be signed in to change notification settings - Fork 8.1k
ext/curl: accept SensitiveParameterValue in curl_setopt #22960
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1625,6 +1625,23 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue | |||||
| CURLcode error = CURLE_OK; | ||||||
| zend_long lval; | ||||||
|
|
||||||
| if (Z_TYPE_P(zvalue) == IS_OBJECT | ||||||
| && instanceof_function(Z_OBJCE_P(zvalue), zend_ce_sensitive_parameter_value)) | ||||||
| { | ||||||
| zval rv; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This theoretically leaks |
||||||
| zval *inner_value; | ||||||
|
|
||||||
| inner_value = zend_read_property_ex( | ||||||
| zend_ce_sensitive_parameter_value, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree with the suggestion - why do a lookup when we know the class type? |
||||||
| Z_OBJ_P(zvalue), | ||||||
| ZSTR_KNOWN(ZEND_STR_VALUE), | ||||||
| 0, | ||||||
| &rv | ||||||
| ); | ||||||
|
|
||||||
| zvalue = inner_value; | ||||||
| } | ||||||
|
|
||||||
| switch (option) { | ||||||
| /* Callable options */ | ||||||
| HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_WRITE, write, PHP_CURL_STDOUT); | ||||||
|
|
||||||
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.
No need for
instanceof,SensitiveParameterValueis final. You can just compare the CE directly.