PLarsen558659 (Community Member) asked a question.

Write code to avoid CWE ID 117 using C#

The samples below comes out differently in static scans, the first produce no errors while the second one does.

How do I come around this Please?

 

var s = string.Format(@"{0}", InputCleansers.ClearLog(data)); //works

var s = $"{InputCleansers.ClearLog(data)}"; //produce flaws ID 117

 

//and the actual logging

_logger.LogInformation(s);


Topics (4)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.