Skip to content

Commit

Permalink
Upgrade System.Text.RegularExpressions to 4.3.1 to solve CVE (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH authored Oct 9, 2024
1 parent df8b0bc commit 45609f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This is a simple generator to create random data.

## NuGet

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

## Supported Random Data

Expand Down
4 changes: 2 additions & 2 deletions src/RandomDataGenerator/FieldOptions/FieldOptionsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public static FieldOptionsAbstract GetFieldOptions(SubFieldType subFieldType)

public static FieldOptionsAbstract GetFieldOptions(string name, Dictionary<string, object> properties)
{
Guard.NotNullOrEmpty(name, nameof(name));
Guard.NotNull(properties, nameof(properties));
Guard.NotNullOrEmpty(name);
Guard.NotNull(properties);

// Generate classname
var className = !name.StartsWith("FieldOptions") ? $"FieldOptions{name}" : name;
Expand Down
11 changes: 8 additions & 3 deletions src/RandomDataGenerator/RandomDataGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@
<EmbeddedResource Include="Data\Text\MaleNames.txt" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net35' ">
<!-- CVE-2019-0820 -->
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0">
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Fare" Version="2.2.0" />
<PackageReference Include="Stef.Validation" Version="0.1.0" />
<PackageReference Include="Fare" Version="2.2.1" />
<PackageReference Include="Stef.Validation" Version="0.1.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
Expand Down
2 changes: 1 addition & 1 deletion tests/RandomDataGenerator.Tests/CityRandomizerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void CityDistributionMustBeUniform(int degree)
{
Parallel.For(0, 1000, options, j =>
{
var location = locationGenerator.Generate();
var location = locationGenerator.Generate() ?? string.Empty;
concurrentDictionary.AddOrUpdate(location, _ => 1, (k, v) => v + 1);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 45609f7

Please sign in to comment.