diff options
author | Julien Pauli <jpauli@php.net> | 2016-09-19 15:01:54 +0200 |
---|---|---|
committer | Julien Pauli <jpauli@php.net> | 2016-09-19 15:16:14 +0200 |
commit | b41abf7496039b24a9a6e0838350870fdc1d9367 (patch) | |
tree | 5d06e2df9b8997547040d58dfb0fa433bdecf79c /ext/json/json.c | |
parent | 2efb1312104815b633e657410814b209ae8fabed (diff) | |
download | php-git-b41abf7496039b24a9a6e0838350870fdc1d9367.tar.gz |
Fix 73113 - Segfault with throwing JsonSerializable
Diffstat (limited to 'ext/json/json.c')
-rw-r--r-- | ext/json/json.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 3bbe532d97..395f11db53 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -230,7 +230,10 @@ static PHP_FUNCTION(json_encode) ZVAL_FALSE(return_value); } else { smart_str_0(&buf); /* copy? */ - ZVAL_NEW_STR(return_value, buf.s); + if (buf.s) { + RETURN_NEW_STR(buf.s); + } + RETURN_EMPTY_STRING(); } } /* }}} */ |