@@ -146,7 +146,7 @@ zp_keyexpr_canon_status_t __zp_canon_prefix(const char *start, size_t *len) {
146
146
char const * next_slash ;
147
147
148
148
do {
149
- next_slash = strchr (chunk_start , '/' );
149
+ next_slash = memchr (chunk_start , '/' , _z_ptr_char_diff ( end , chunk_start ) );
150
150
const char * chunk_end = next_slash ? next_slash : end ;
151
151
size_t chunk_len = _z_ptr_char_diff (chunk_end , chunk_start );
152
152
switch (chunk_len ) {
@@ -291,7 +291,7 @@ void __zp_ke_write_chunk(char **writer, const char *chunk, size_t len, const cha
291
291
writer [0 ] = _z_ptr_char_offset (writer [0 ], 1 );
292
292
}
293
293
294
- (void )memcpy (writer [0 ], chunk , len );
294
+ (void )memmove (writer [0 ], chunk , len );
295
295
writer [0 ] = _z_ptr_char_offset (writer [0 ], (ptrdiff_t )len );
296
296
}
297
297
@@ -766,10 +766,9 @@ zp_keyexpr_canon_status_t _z_keyexpr_canonize(char *start, size_t *len) {
766
766
} else {
767
767
assert (false); // anything before "$*" or "**" must be part of the canon prefix
768
768
}
769
-
770
769
while (next_slash != NULL ) {
771
770
reader = _z_ptr_char_offset (next_slash , 1 );
772
- next_slash = strchr (reader , '/' );
771
+ next_slash = memchr (reader , '/' , _z_ptr_char_diff ( end , reader ) );
773
772
chunk_end = next_slash ? next_slash : end ;
774
773
switch (_z_ptr_char_diff (chunk_end , reader )) {
775
774
case 0 : {
0 commit comments