diff --git a/eng/Versions.props b/eng/Versions.props
index 1f6da59091f96c..9394929d56e9e6 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -233,7 +233,7 @@
8.0.0-rtm.26407.4
- 2.5.9
+ 2.5.10
16.0.5-alpha.1.25311.1
16.0.5-alpha.1.25311.1
diff --git a/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h b/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h
index 57f5c125742fab..869e9ba9d2ecf0 100644
--- a/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h
+++ b/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h
@@ -231,9 +231,12 @@ ds_rt_transport_get_default_name (
STATIC_CONTRACT_NOTHROW;
#ifdef TARGET_UNIX
+ // PAL_GetTransportName returns void, but sets name[0] to '\0' when it fails to generate a name.
PAL_GetTransportName (name_len, name, prefix, id, group_id, suffix);
+ return name [0] != '\0';
+#else
+ return false;
#endif
- return true;
}
/*
diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs
index 57deaec43a6d8e..a9e0bca950d902 100644
--- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs
+++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs
@@ -219,15 +219,9 @@ internal void AddHeader(string header)
string val = header.AsSpan(colon + 1).Trim().ToString();
if (name.Equals("content-length", StringComparison.OrdinalIgnoreCase))
{
- // To match Windows behavior:
- // Content lengths >= 0 and <= long.MaxValue are accepted as is.
- // Content lengths > long.MaxValue and <= ulong.MaxValue are treated as 0.
- // Content lengths < 0 cause the requests to fail.
- // Other input is a failure, too.
- long parsedContentLength =
- ulong.TryParse(val, out ulong parsedUlongContentLength) ? (parsedUlongContentLength <= long.MaxValue ? (long)parsedUlongContentLength : 0) :
- long.Parse(val);
- if (parsedContentLength < 0 || (_clSet && parsedContentLength != _contentLength))
+ // Match the Windows parser shape: strict decimal parsing, and reject on parse failure.
+ bool success = long.TryParse(val, NumberStyles.None, CultureInfo.InvariantCulture.NumberFormat, out long parsedContentLength);
+ if (!success || (_clSet && parsedContentLength != _contentLength))
{
_context.ErrorMessage = "Invalid Content-Length.";
}
diff --git a/src/libraries/System.Net.HttpListener/tests/HttpListenerRequestTests.cs b/src/libraries/System.Net.HttpListener/tests/HttpListenerRequestTests.cs
index 1f2057a9480536..10b6f9e80244b9 100644
--- a/src/libraries/System.Net.HttpListener/tests/HttpListenerRequestTests.cs
+++ b/src/libraries/System.Net.HttpListener/tests/HttpListenerRequestTests.cs
@@ -126,8 +126,6 @@ public async Task ContentEncoding_NoBody_ReturnsDefault()
[Theory]
[InlineData("POST", "Content-Length: 9223372036854775807", 9223372036854775807, true)] // long.MaxValue
- [InlineData("POST", "Content-Length: 9223372036854775808", 0, false)] // long.MaxValue + 1
- [InlineData("POST", "Content-Length: 18446744073709551615 ", 0, false)] // ulong.MaxValue
[InlineData("POST", "Content-Length: 0", 0, false)]
[InlineData("PUT", "Content-Length: 0", 0, false)]
[InlineData("PUT", "Content-Length: 1", 1, true)]
diff --git a/src/libraries/System.Net.HttpListener/tests/InvalidClientRequestTests.cs b/src/libraries/System.Net.HttpListener/tests/InvalidClientRequestTests.cs
index 739c5b2711f345..76732e7c918bf3 100644
--- a/src/libraries/System.Net.HttpListener/tests/InvalidClientRequestTests.cs
+++ b/src/libraries/System.Net.HttpListener/tests/InvalidClientRequestTests.cs
@@ -74,6 +74,8 @@ public static IEnumerable