Permalink
Browse files

Fix Bug #53963, error code isn't always set in certain error cases.

  • Loading branch information...
1 parent efa9a8e commit 18b7f018e369977069a3cf27ee483a709a9ecb4e Scott MacVicar committed Feb 9, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 ext/json/JSON_parser.c
View
2 ext/json/JSON_parser.c
@@ -673,6 +673,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
/* fall through if not IS_STRING */
default:
FREE_BUFFERS();
+ jp->error_code = PHP_JSON_ERROR_SYNTAX;
return false;
}
break;
@@ -712,6 +713,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
break;
default:
FREE_BUFFERS();
+ jp->error_code = PHP_JSON_ERROR_SYNTAX;
return false;
}
buf.len = 0;

0 comments on commit 18b7f01

Please sign in to comment.