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 {
21
21
* Gets then `n`th formatted argument of this call.
22
22
*/
23
23
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 ( ) }
24
27
}
25
28
26
29
/**
@@ -46,6 +49,8 @@ class KernelPrintfCall extends PrintfStyleCall {
46
49
then result = this .getArgument ( 0 )
47
50
else result = this .getArgument ( [ 0 , 1 ] )
48
51
}
52
+
53
+ override predicate returnsFormatted ( ) { none ( ) }
49
54
}
50
55
51
56
/**
@@ -58,6 +63,8 @@ class KernelSprintfCall extends PrintfStyleCall {
58
63
this .asExpr ( ) .getExpr ( ) instanceof UnknownMethodCall and
59
64
this .getMethodName ( ) = "sprintf"
60
65
}
66
+
67
+ override predicate returnsFormatted ( ) { any ( ) }
61
68
}
62
69
63
70
/**
@@ -67,4 +74,6 @@ class IOPrintfCall extends PrintfStyleCall {
67
74
IOPrintfCall ( ) {
68
75
this .getReceiver ( ) instanceof IO:: IOInstance and this .getMethodName ( ) = "printf"
69
76
}
77
+
78
+ override predicate returnsFormatted ( ) { none ( ) }
70
79
}
You can’t perform that action at this time.
0 commit comments