Skip to content

Commit 471a762

Browse files
committed
Another fix for uriparser
1 parent 7541b33 commit 471a762

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/uri/uriparser/src/UriCopy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ int URI_FUNC(CopyUriMm)(URI_TYPE(Uri) * destUri,
153153
*(destUri->hostData.ip6) = *(sourceUri->hostData.ip6);
154154
}
155155

156-
if (URI_FUNC(CopyRangeAsNeeded)(&destUri->hostData.ipFuture, &sourceUri->hostData.ipFuture, URI_FALSE, memory) == URI_FALSE) {
156+
if (sourceUri->hostData.ipFuture.first != NULL && sourceUri->hostText.first == sourceUri->hostData.ipFuture.first) {
157+
destUri->hostData.ipFuture.first = destUri->hostText.first;
158+
destUri->hostData.ipFuture.afterLast = destUri->hostText.afterLast;
159+
} else if (URI_FUNC(CopyRangeAsNeeded)(&destUri->hostData.ipFuture, &sourceUri->hostData.ipFuture, URI_FALSE, memory) == URI_FALSE) {
157160
URI_FUNC(PreventLeakageAfterCopy)(destUri, doneMask, memory);
158161
return URI_ERROR_MALLOC;
159162
}

0 commit comments

Comments
 (0)