aboutsummaryrefslogtreecommitdiffstats
path: root/php/ext
diff options
context:
space:
mode:
authorDavid Supplee <dwsupplee@gmail.com>2019-03-12 21:30:06 -0700
committerPaul Yang <TeBoring@users.noreply.github.com>2019-03-12 21:30:06 -0700
commit93533f780be4ed5ea4d866c5eb7ff2220f377ae0 (patch)
treee6ceff1770a8455af7dfc2eeebcda0730a9ffc2e /php/ext
parent791b86368778e21fd4936f0f8674daff44046dff (diff)
downloadplatform_external_protobuf-93533f780be4ed5ea4d866c5eb7ff2220f377ae0.tar.gz
platform_external_protobuf-93533f780be4ed5ea4d866c5eb7ff2220f377ae0.tar.bz2
platform_external_protobuf-93533f780be4ed5ea4d866c5eb7ff2220f377ae0.zip
Add terminating character to zend_lookup_class call (#5871)
* add terminating character * adjust name length input * add test cases * correct script name * Misc fixes * add new script to EXTRA_DIST list
Diffstat (limited to 'php/ext')
-rw-r--r--php/ext/google/protobuf/def.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c
index ef0f71167..184ae2d36 100644
--- a/php/ext/google/protobuf/def.c
+++ b/php/ext/google/protobuf/def.c
@@ -853,9 +853,10 @@ static zend_class_entry *register_class(const upb_filedef *file,
fill_namespace(package, php_namespace, &namesink);
fill_classname(fullname, package, prefix, &namesink, use_nested_submsg);
+ stringsink_string(&namesink, NULL, "\0", 1, NULL);
PHP_PROTO_CE_DECLARE pce;
- if (php_proto_zend_lookup_class(namesink.ptr, namesink.len, &pce) ==
+ if (php_proto_zend_lookup_class(namesink.ptr, namesink.len - 1, &pce) ==
FAILURE) {
zend_error(
E_ERROR,