@@ -107,7 +107,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
107107 goto fail ;
108108 }
109109 memcpy (copy , buf , len );
110- copy [ len ] = ' ' ;
110+ memset ( copy + len , ' ' , sizeof ( uint64_t )) ;
111111 if (!is_valid_true_atom (reinterpret_cast < const uint8_t * > (copy ) + idx )) {
112112 free (copy );
113113 goto fail ;
@@ -127,7 +127,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
127127 goto fail ;
128128 }
129129 memcpy (copy , buf , len );
130- copy [ len ] = ' ' ;
130+ memset ( copy + len , ' ' , sizeof ( uint64_t )) ;
131131 if (!is_valid_false_atom (reinterpret_cast < const uint8_t * > (copy ) + idx )) {
132132 free (copy );
133133 goto fail ;
@@ -146,7 +146,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
146146 goto fail ;
147147 }
148148 memcpy (copy , buf , len );
149- copy [ len ] = ' ' ;
149+ memset ( copy + len , ' ' , sizeof ( uint64_t )) ;
150150 if (!is_valid_null_atom (reinterpret_cast < const uint8_t * > (copy ) + idx )) {
151151 free (copy );
152152 goto fail ;
@@ -178,7 +178,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
178178 goto fail ;
179179 }
180180 memcpy (copy , buf , len );
181- copy [ len ] = ' ' ;
181+ memset ( copy + len , ' ' , SIMDJSON_PADDING ) ;
182182 if (!parse_number (reinterpret_cast < const uint8_t * > (copy ), pj , idx ,
183183 false)) {
184184 free (copy );
@@ -197,7 +197,7 @@ unified_machine(const uint8_t *buf, size_t len, ParsedJson &pj) {
197197 goto fail ;
198198 }
199199 memcpy (copy , buf , len );
200- copy [ len ] = ' ' ;
200+ memset ( copy + len , ' ' , SIMDJSON_PADDING ) ;
201201 if (!parse_number (reinterpret_cast < const uint8_t * > (copy ), pj , idx , true)) {
202202 free (copy );
203203 goto fail ;
0 commit comments