Audit zend_ini_string() and related functions#21146
Audit zend_ini_string() and related functions#21146Girgias wants to merge 13 commits intophp:masterfrom
Conversation
58f9395 to
5095e2f
Compare
13411e8 to
cb2e357
Compare
arnaud-lb
left a comment
There was a problem hiding this comment.
Looks good to me.
One caveat with ZEND_STRL() is that it would break if the outer function call was turned into a macro, as it is seen as a single argument during expansion.
An alternative to removing INI_STR(), that would also eliminate the need for ZEND_STRL(), would be to introduce _literal variants of zend_ini_str(ing)(_ex), like we have in the string API, and then remove or deprecate INI_STR(). But then we might want to also add _literal variants of the other zend_ini_ functions to replace all INI_ macros. No strong opinion on this.
I quite like the idea of using a new literal API variant, will do this and check what the usage of thoses macros are with sourcegraph to see if it is reasonable to remove them outright or not. |
cb2e357 to
76ebba6
Compare
A sourcegraph search shows 0 results other than for the buggy BOOL one in ext/tidy
76ebba6 to
fb66db3
Compare
It is used as a target for snprintf, so must be mutable
…y string rather than NULL in certain cases
Conflicts with #21143I audited the usage of
zend_ini_string()and co as I believe these functions should return aconst char*because they point to a pointer owner by azend_string *.The two other things I am wondering is
INI_STR()macro as it doesn't follow the usual convention of "string" being achar*and "str" meaning azend_string*.INI_ORIG_*macros as they seem mostly pointless?