Skip to content

Commit

Permalink
Fix code scanning alert no. 40: Log entries created from user input
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
JoeShook and github-advanced-security[bot] authored Oct 7, 2024
1 parent 96b64a5 commit 8e3f07a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Udap.Common/Metadata/UdapMetaDataBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public string GetCommunitiesAsHtml(string path)

if (certificate == null)
{
_logger.LogWarning("Missing default community certificate: {Community}", System.Web.HttpUtility.UrlEncode(community));
var sanitizedCommunity = System.Web.HttpUtility.UrlEncode(community).Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "");

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 104 in Udap.Common/Metadata/UdapMetaDataBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
_logger.LogWarning("Missing default community certificate: {Community}", sanitizedCommunity);
return null;
}

Expand Down

0 comments on commit 8e3f07a

Please sign in to comment.