Skip to content

Commit c253bdd

Browse files
committed
Ruby: Make getFormatArgument 0-indexed
1 parent c73dc8a commit c253bdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/ql/lib/codeql/ruby/security/TaintedFormatStringSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class PrintfStyleCall extends DataFlow::CallNode {
2121
/**
2222
* Gets then `n`th formatted argument of this call.
2323
*/
24-
DataFlow::Node getFormatArgument(int n) { n > 0 and result = this.getArgument(n) }
24+
DataFlow::Node getFormatArgument(int n) { n >= 0 and result = this.getArgument(n + 1) }
2525
}
2626

2727
/**

0 commit comments

Comments
 (0)