Skip to content

Commit 45609f7

Browse files
authored
Upgrade System.Text.RegularExpressions to 4.3.1 to solve CVE (#27)
1 parent df8b0bc commit 45609f7

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is a simple generator to create random data.
33

44
## NuGet
55

6-
[![NuGet Badge](https://buildstats.info/nuget/RandomDataGenerator.Net)](https://www.nuget.org/packages/RandomDataGenerator.Net)
6+
[![NuGet Badge](https://img.shields.io/nuget/v/RandomDataGenerator.Net)](https://www.nuget.org/packages/RandomDataGenerator.Net)
77

88
## Supported Random Data
99

src/RandomDataGenerator/FieldOptions/FieldOptionsFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public static FieldOptionsAbstract GetFieldOptions(SubFieldType subFieldType)
1919

2020
public static FieldOptionsAbstract GetFieldOptions(string name, Dictionary<string, object> properties)
2121
{
22-
Guard.NotNullOrEmpty(name, nameof(name));
23-
Guard.NotNull(properties, nameof(properties));
22+
Guard.NotNullOrEmpty(name);
23+
Guard.NotNull(properties);
2424

2525
// Generate classname
2626
var className = !name.StartsWith("FieldOptions") ? $"FieldOptions{name}" : name;

src/RandomDataGenerator/RandomDataGenerator.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,17 @@
4747
<EmbeddedResource Include="Data\Text\MaleNames.txt" />
4848
</ItemGroup>
4949

50+
<ItemGroup Condition=" '$(TargetFramework)' != 'net35' ">
51+
<!-- CVE-2019-0820 -->
52+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
53+
</ItemGroup>
54+
5055
<ItemGroup>
51-
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0">
56+
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0">
5257
<PrivateAssets>All</PrivateAssets>
5358
</PackageReference>
54-
<PackageReference Include="Fare" Version="2.2.0" />
55-
<PackageReference Include="Stef.Validation" Version="0.1.0" />
59+
<PackageReference Include="Fare" Version="2.2.1" />
60+
<PackageReference Include="Stef.Validation" Version="0.1.1" />
5661
</ItemGroup>
5762

5863
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">

tests/RandomDataGenerator.Tests/CityRandomizerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void CityDistributionMustBeUniform(int degree)
3030
{
3131
Parallel.For(0, 1000, options, j =>
3232
{
33-
var location = locationGenerator.Generate();
33+
var location = locationGenerator.Generate() ?? string.Empty;
3434
concurrentDictionary.AddOrUpdate(location, _ => 1, (k, v) => v + 1);
3535
});
3636
});

tests/RandomDataGenerator.Tests/RandomDataGenerator.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
87
<IsPackable>false</IsPackable>
98
</PropertyGroup>
109

1110
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1312
<PackageReference Include="xunit" Version="2.4.2" />
1413
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1514
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)