Skip to content

Commit 4c9d02e

Browse files
authored
Configuration: Fixed integer overflow in setting MaxRequestBodySize and MultipartBodyLengthLimit (#20348)
Fixed integer overflow in setting MaxRequestBodySize and MultipartBodyLengthLimit.
1 parent 7d87ce3 commit 4c9d02e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Umbraco.Web.Common/Security/ConfigureFormOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public void Configure(FormOptions options) =>
1414

1515
// convert from KB to bytes
1616
options.MultipartBodyLengthLimit = _runtimeSettings.Value.MaxRequestLength.HasValue
17-
? _runtimeSettings.Value.MaxRequestLength.Value * 1024
17+
? (long)_runtimeSettings.Value.MaxRequestLength.Value * 1024
1818
: long.MaxValue;
1919
}

src/Umbraco.Web.Common/Security/ConfigureKestrelServerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public void Configure(KestrelServerOptions options) =>
1515

1616
// convert from KB to bytes, 52428800 bytes (50 MB) is the same as in the IIS settings
1717
options.Limits.MaxRequestBodySize = _runtimeSettings.Value.MaxRequestLength.HasValue
18-
? _runtimeSettings.Value.MaxRequestLength.Value * 1024
18+
? (long)_runtimeSettings.Value.MaxRequestLength.Value * 1024
1919
: 52428800;
2020
}

0 commit comments

Comments
 (0)