File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
csharp/ql/lib/semmle/code/csharp Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,14 @@ class SystemStringClass extends StringType {
354354 result .getReturnType ( ) instanceof StringType
355355 }
356356
357+ /** Gets the `ReplaceLineEndings(string) method. */
358+ Method getReplaceLineEndingsMethod ( ) {
359+ result .getDeclaringType ( ) = this and
360+ result .hasName ( "ReplaceLineEndings" ) and
361+ result .getNumberOfParameters ( ) = 1 and
362+ result .getReturnType ( ) instanceof StringType
363+ }
364+
357365 /** Gets a `Format(...)` method. */
358366 Method getFormatMethod ( ) {
359367 result .getDeclaringType ( ) = this and
Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ private class ExternalLoggingExprSink extends Sink {
7070private class StringReplaceSanitizer extends Sanitizer {
7171 StringReplaceSanitizer ( ) {
7272 exists ( Method m |
73- exists ( SystemStringClass s | m = s .getReplaceMethod ( ) or m = s .getRemoveMethod ( ) )
73+ exists ( SystemStringClass s |
74+ m = s .getReplaceMethod ( ) or m = s .getRemoveMethod ( ) or m = s .getReplaceLineEndingsMethod ( )
75+ )
7476 or
7577 m = any ( SystemTextRegularExpressionsRegexClass r ) .getAReplaceMethod ( )
7678 |
You can’t perform that action at this time.
0 commit comments