[pypy-commit] pypy fastjson: kill one more end-of-string check

antocuni noreply at buildbot.pypy.org
Sun Jun 9 11:42:06 CEST 2013


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: fastjson
Changeset: r64841:2a2c1967e1c1
Date: 2013-06-07 18:38 +0200
http://bitbucket.org/pypy/pypy/changeset/2a2c1967e1c1/

Log:	kill one more end-of-string check

diff --git a/pypy/module/_fastjson/interp_decoder.py b/pypy/module/_fastjson/interp_decoder.py
--- a/pypy/module/_fastjson/interp_decoder.py
+++ b/pypy/module/_fastjson/interp_decoder.py
@@ -177,7 +177,7 @@
         start = i
         count = 0
         i = self.skip_whitespace(start)
-        while i < self.length:
+        while True:
             ch = self.ll_chars[i]
             if ch == ']':
                 self.pos = i+1
@@ -193,10 +193,11 @@
                 return w_list
             elif ch == ',':
                 pass
+            elif ch == '\0':
+                self._raise("Unterminated array starting at char %d", start)
             else:
                 self._raise("Unexpected '%s' when decoding array (char %d)",
                             ch, self.pos)
-        self._raise("Unterminated array starting at char %d", start)
 
 
     def decode_object(self, i):


More information about the pypy-commit mailing list