File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ abstract class PrintfStyleCall extends DataFlow::CallNode {
2121 * Gets then `n`th formatted argument of this call.
2222 */
2323 DataFlow:: Node getFormatArgument ( int n ) { n >= 0 and result = this .getArgument ( n + 1 ) }
24+
25+ /** Holds if this call returns the formatted string. */
26+ predicate returnsFormatted ( ) { any ( ) }
2427}
2528
2629/**
@@ -46,6 +49,8 @@ class KernelPrintfCall extends PrintfStyleCall {
4649 then result = this .getArgument ( 0 )
4750 else result = this .getArgument ( [ 0 , 1 ] )
4851 }
52+
53+ override predicate returnsFormatted ( ) { none ( ) }
4954}
5055
5156/**
@@ -58,6 +63,8 @@ class KernelSprintfCall extends PrintfStyleCall {
5863 this .asExpr ( ) .getExpr ( ) instanceof UnknownMethodCall and
5964 this .getMethodName ( ) = "sprintf"
6065 }
66+
67+ override predicate returnsFormatted ( ) { any ( ) }
6168}
6269
6370/**
@@ -67,4 +74,6 @@ class IOPrintfCall extends PrintfStyleCall {
6774 IOPrintfCall ( ) {
6875 this .getReceiver ( ) instanceof IO:: IOInstance and this .getMethodName ( ) = "printf"
6976 }
77+
78+ override predicate returnsFormatted ( ) { none ( ) }
7079}
You can’t perform that action at this time.
0 commit comments