Skip to content

Commit 9d36ab9

Browse files
authored
Merge pull request github#13606 from alexrford/rb/sqlite3-getSql
Ruby: fix sqlite3 `PreparedStatementExecution.getSql()` predicate
2 parents 42356a8 + ede6b26 commit 9d36ab9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ruby/ql/lib/codeql/ruby/frameworks/Sqlite3.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Sqlite3 {
4848
this.getMethodName() = ["columns", "execute", "execute!", "get_metadata", "types"]
4949
}
5050

51-
override DataFlow::Node getSql() { result = stmt.getReceiver() }
51+
override DataFlow::Node getSql() { result = stmt.getSql() }
5252
}
5353

5454
/** Gets the name of a method called against a database that executes an SQL statement. */

ruby/ql/test/library-tests/frameworks/sqlite3/Sqlite3.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ sqlite3SqlConstruction
55
| sqlite3.rb:29:7:29:40 | call to execute | sqlite3.rb:29:19:29:39 | "select * from table" |
66
sqlite3SqlExecution
77
| sqlite3.rb:5:1:5:17 | call to execute | sqlite3.rb:5:12:5:17 | <<-SQL |
8-
| sqlite3.rb:14:1:14:12 | call to execute | sqlite3.rb:12:8:12:9 | db |
8+
| sqlite3.rb:14:1:14:12 | call to execute | sqlite3.rb:12:19:12:41 | "select * from numbers" |
99
| sqlite3.rb:17:3:19:5 | call to execute | sqlite3.rb:17:15:17:35 | "select * from table" |
1010
| sqlite3.rb:29:7:29:40 | call to execute | sqlite3.rb:29:19:29:39 | "select * from table" |

0 commit comments

Comments
 (0)