Re: svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/json/JSON_parser.c trunk/ext/json/JSON_parser.c

From: Date: Fri, 11 Feb 2011 23:33:52 +0000
Subject: Re: svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/json/JSON_parser.c trunk/ext/json/JSON_parser.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-64533@lists.php.net to get a copy of this message
Scott, Are there any tests for this? Chris On 02/09/2011 12:05 AM, Scott MacVicar wrote:
scottmac                                 Wed, 09 Feb 2011 08:05:00 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308155 Log: Fix Bug #53963, error code isn't always set in certain error cases. Bug: http://bugs.php.net/53963 (Assigned) Failed to decode, yet json_last_error() is JSON_ERROR_NONE Changed paths:
     U   php/php-src/branches/PHP_5_3/NEWS
     U   php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c
     U   php/php-src/trunk/ext/json/JSON_parser.c
Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-09 08:05:00 UTC (rev 308155) @@ -75,6 +75,10 @@
    . Implemented clone functionality for number, date&  message formatters.
      (Stas).
+- JSON extension: + . Fixed bug #53963 (Ensure error_code is always set during some failed
+    decodings). (Scott)
+ - MySQL Improved extension:
    . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847).
      (Kalle)
Modified: php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c 2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c 2011-02-09 08:05:00 UTC (rev 308155) @@ -656,6 +656,7 @@ /* fall through if not IS_STRING */
                  default:
                      FREE_BUFFERS();
+                    jp->error_code = PHP_JSON_ERROR_SYNTAX;
                      return false;
                  }
                  break;
@@ -695,6 +696,7 @@
                          break;
                      default:
                          FREE_BUFFERS();
+                        jp->error_code = PHP_JSON_ERROR_SYNTAX;
                          return false;
                  }
                  buf.len = 0;
Modified: php/php-src/trunk/ext/json/JSON_parser.c =================================================================== --- php/php-src/trunk/ext/json/JSON_parser.c 2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/trunk/ext/json/JSON_parser.c 2011-02-09 08:05:00 UTC (rev 308155) @@ -673,6 +673,7 @@ /* fall through if not IS_STRING */
                  default:
                      FREE_BUFFERS();
+                    jp->error_code = PHP_JSON_ERROR_SYNTAX;
                      return false;
                  }
                  break;
@@ -712,6 +713,7 @@
                          break;
                      default:
                          FREE_BUFFERS();
+                        jp->error_code = PHP_JSON_ERROR_SYNTAX;
                          return false;
                  }
                  buf.len = 0;
-- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/

« previous php.cvs (#64533) next »