From a7b3abe4e6f5e2fdfd8d55b676c9ca6b3f9c8cc8 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 2 Feb 2015 11:07:34 +0000 Subject: json_decode() should generate a syntax error when given "". Fixes bug #68938 (json_decode() decodes empty string without error). Patch by jeremy at bat-country dot us. --- ext/json/json.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/json/json.c') diff --git a/ext/json/json.c b/ext/json/json.c index 5b71eb06f6..27aed969d9 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -818,6 +818,7 @@ static PHP_FUNCTION(json_decode) JSON_G(error_code) = 0; if (!str_len) { + JSON_G(error_code) = PHP_JSON_ERROR_SYNTAX; RETURN_NULL(); } -- cgit v1.2.1