File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -369,24 +369,19 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_path_read(void
369369
370370 zend_string * str = zend_string_alloc (total_len , false);
371371 char * out = ZSTR_VAL (str );
372- size_t pos = 0 ;
373372
374373 if (need_leading_slash ) {
375- out [ pos ++ ] = '/' ;
374+ * ( out ++ ) = '/' ;
376375 }
377376
378377 for (const UriPathSegmentA * p = uriparser_uri -> pathHead ; p ; p = p -> next ) {
379- const size_t len = get_text_range_length (& p -> text );
380- if (len > 0 ) {
381- memcpy (out + pos , p -> text .first , len );
382- pos += len ;
383- }
378+ out = zend_mempcpy (out , p -> text .first , get_text_range_length (& p -> text ));
384379 if (p -> next ) {
385- out [ pos ++ ] = '/' ;
380+ * ( out ++ ) = '/' ;
386381 }
387382 }
388383
389- out [ total_len ] = '\0' ;
384+ * out = '\0' ;
390385 ZVAL_STR (retval , str );
391386 } else if (uriparser_uri -> absolutePath ) {
392387 ZVAL_CHAR (retval , '/' );
You can’t perform that action at this time.
0 commit comments