summaryrefslogtreecommitdiff
path: root/lib/php
diff options
context:
space:
mode:
authorJosip Sokcevic <info@sokac.net>2019-02-20 23:15:08 -0800
committerJames E. King III <jking@apache.org>2019-02-22 06:21:28 -0500
commita4ee1f281bc4ec4b08efe3a5b3408738d7f9f516 (patch)
treefdd3f587aa01167cae1246ad3f6bc97b966c0aa7 /lib/php
parentc6b019affd5f6b9598069e3d5d3f78dec035cb1a (diff)
downloadthrift-a4ee1f281bc4ec4b08efe3a5b3408738d7f9f516.tar.gz
THRIFT-4807: Fix php segfault on reference pass
Client: php (extension) When reference is passed to php extension, it's unreferenced (instead of derefrenced). The next time one tries to use the same variable PHP segaults. Even if not used again, php segfaults on user_shutdown_function_call.
Diffstat (limited to 'lib/php')
-rw-r--r--lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
index 63c8905a5..e152d08a3 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
@@ -1013,7 +1013,7 @@ void binary_serialize_spec(zval* zthis, PHPOutputTransport& transport, HashTable
zval* prop = zend_read_property(Z_OBJCE_P(zthis), zthis, varname, strlen(varname), false, &rv);
if (Z_TYPE_P(prop) == IS_REFERENCE){
- ZVAL_UNREF(prop);
+ ZVAL_DEREF(prop);
}
if (Z_TYPE_P(prop) != IS_NULL) {
transport.writeI8(ttype);