From 8bb6b81c60851e35383cb59b6ffa0a1fed98151a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 4 Jul 2025 08:20:27 +0200 Subject: [PATCH 1/2] Update uriparser to commit 8c06d --- ext/uri/uriparser/include/uriparser/Uri.h | 8 ++++++++ ext/uri/uriparser/src/UriCopy.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/uri/uriparser/include/uriparser/Uri.h b/ext/uri/uriparser/include/uriparser/Uri.h index f0f2ad9a34bd0..9f08559a1858f 100644 --- a/ext/uri/uriparser/include/uriparser/Uri.h +++ b/ext/uri/uriparser/include/uriparser/Uri.h @@ -334,6 +334,10 @@ URI_PUBLIC int URI_FUNC(ParseSingleUriExMm)(URI_TYPE(Uri) * uri, * itself is not freed, only its members. * Uses default libc-based memory manager. * + * @remarks + * Calling on an all-zeros structure (e.g. through memset or calloc) is safe.
+ * Calling on an uninitialized structure is not safe. + * * @param uri INOUT: %URI structure whose members should be freed * * @see uriFreeUriMembersMmA @@ -348,6 +352,10 @@ URI_PUBLIC void URI_FUNC(FreeUriMembers)(URI_TYPE(Uri) * uri); * of the %URI structure. Note that the structure * itself is not freed, only its members. * + * @remarks + * Calling on an all-zeros structure (e.g. through memset or calloc) is safe.
+ * Calling on an uninitialized structure is not safe. + * * @param uri INOUT: %URI structure whose members should be freed * @param memory IN: Memory manager to use, NULL for default libc * @return 0 on success, error code otherwise diff --git a/ext/uri/uriparser/src/UriCopy.c b/ext/uri/uriparser/src/UriCopy.c index 0974ec5c0406d..103e2e7796751 100644 --- a/ext/uri/uriparser/src/UriCopy.c +++ b/ext/uri/uriparser/src/UriCopy.c @@ -111,6 +111,8 @@ int URI_FUNC(CopyUriMm)(URI_TYPE(Uri) * destUri, URI_CHECK_MEMORY_MANAGER(memory); /* may return */ + URI_FUNC(ResetUri)(destUri); + if (URI_FUNC(CopyRangeAsNeeded)(&destUri->scheme, &sourceUri->scheme, URI_FALSE, memory) == URI_FALSE) { return URI_ERROR_MALLOC; } @@ -153,7 +155,10 @@ int URI_FUNC(CopyUriMm)(URI_TYPE(Uri) * destUri, *(destUri->hostData.ip6) = *(sourceUri->hostData.ip6); } - if (URI_FUNC(CopyRangeAsNeeded)(&destUri->hostData.ipFuture, &sourceUri->hostData.ipFuture, URI_FALSE, memory) == URI_FALSE) { + if (sourceUri->hostData.ipFuture.first != NULL && sourceUri->hostText.first == sourceUri->hostData.ipFuture.first) { + destUri->hostData.ipFuture.first = destUri->hostText.first; + destUri->hostData.ipFuture.afterLast = destUri->hostText.afterLast; + } else if (URI_FUNC(CopyRangeAsNeeded)(&destUri->hostData.ipFuture, &sourceUri->hostData.ipFuture, URI_FALSE, memory) == URI_FALSE) { URI_FUNC(PreventLeakageAfterCopy)(destUri, doneMask, memory); return URI_ERROR_MALLOC; } From 75006cf21dbc73bd4a566c9960bb1bda3e2060b5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 4 Jul 2025 08:33:07 +0200 Subject: [PATCH 2/2] avoid false failure for long path (#18992) --- sapi/fpm/tests/socket-uds-too-long-filename-start.phpt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sapi/fpm/tests/socket-uds-too-long-filename-start.phpt b/sapi/fpm/tests/socket-uds-too-long-filename-start.phpt index a7b43d9519b0a..1baf47a466a42 100644 --- a/sapi/fpm/tests/socket-uds-too-long-filename-start.phpt +++ b/sapi/fpm/tests/socket-uds-too-long-filename-start.phpt @@ -40,11 +40,7 @@ $tester->expectLogPattern( $files = glob($socketFilePrefix . '*'); -if ($files === []) { - echo 'Socket files were not found.' . PHP_EOL; -} - -if ($socketFile === $files[0]) { +if (isset($files[0]) && $socketFile === $files[0]) { // this means the socket file path length is not an issue (anymore). Might be not long enough echo 'Socket file is the same as configured.' . PHP_EOL; }