summaryrefslogtreecommitdiff
path: root/ext/pcre/pcre2lib/pcre2_serialize.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-06-29 17:38:14 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-06-29 19:05:02 +0200
commita385cfa7ad7fe3621bb6095ff88bc8d74b358df0 (patch)
tree75babdefc6eb3793530945a6a4aa43c6c36666ba /ext/pcre/pcre2lib/pcre2_serialize.c
parent816b4c1235d70b1b83d26c415f044fc04a48875f (diff)
downloadphp-git-a385cfa7ad7fe3621bb6095ff88bc8d74b358df0.tar.gz
Fix #63208: BSTR to PHP string conversion not binary safe
A `BSTR` is similar to a `zend_string`; it stores the length of the string just before the actual string, and thus the string may contain NUL bytes. However, `php_com_olestring_to_string()` is supposed to deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we introduce `php_com_bstr_to_string()` and use it for the only case where we actually have to deal with `BSTR`s which may contain NUL bytes. Contrary to `php_com_olestring_to_string()` we return a `zend_string`, so we can save the re-allocation when converting to a `zval`. We also cater to `php_com_string_to_olestring()` not being binary safe, with basically the same fix we did for `php_com_olestring_to_string()`.
Diffstat (limited to 'ext/pcre/pcre2lib/pcre2_serialize.c')
0 files changed, 0 insertions, 0 deletions