Skip to content

Commit 1919b2d

Browse files
simon-idtlhunter
authored andcommitted
Fix #2938 (#2976)
* Update sql-injection-analyzer.js * cleanup
1 parent da8de7e commit 1919b2d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/datadog-instrumentations/src/pg.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ function wrapQuery (query) {
3030
const callbackResource = new AsyncResource('bound-anonymous-fn')
3131
const asyncResource = new AsyncResource('bound-anonymous-fn')
3232
const processId = this.processID
33-
let pgQuery = {}
34-
pgQuery.text = arguments[0]
33+
let pgQuery = {
34+
text: arguments[0]
35+
}
3536

3637
return asyncResource.runInAsyncScope(() => {
3738
startCh.publish({

packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class SqlInjectionAnalyzer extends InjectionAnalyzer {
66
super('SQL_INJECTION')
77
this.addSub('apm:mysql:query:start', ({ sql }) => this.analyze(sql))
88
this.addSub('apm:mysql2:query:start', ({ sql }) => this.analyze(sql))
9-
this.addSub('apm:pg:query:start', ({ originalQuery }) => this.analyze(originalQuery))
9+
this.addSub('apm:pg:query:start', ({ query }) => this.analyze(query.text))
1010
}
1111
}
1212

0 commit comments

Comments
 (0)