File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import json
33import threading
44
55from cpython.bytes cimport PyBytes_AsString
6+ from cpython.bytes cimport PyBytes_AsStringAndSize
67from libc.float cimport DBL_MAX
78from libc.math cimport INFINITY, modf
89
@@ -335,8 +336,10 @@ cdef class _ResultIterator(object):
335336 self ._slurp = slurp
336337 self ._ready = False
337338 cdef jv_parser* parser = jv_parser_new(0 )
338- cdef char * cbytes_input = PyBytes_AsString(bytes_input)
339- jv_parser_set_buf(parser, cbytes_input, len (bytes_input), 0 )
339+ cdef char * cbytes_input
340+ cdef ssize_t clen_input
341+ PyBytes_AsStringAndSize(bytes_input, & cbytes_input, & clen_input)
342+ jv_parser_set_buf(parser, cbytes_input, clen_input, 0 )
340343 self ._parser = parser
341344
342345 def __iter__ (self ):
You can’t perform that action at this time.
0 commit comments