Skip to content

Commit 1dc93ac

Browse files
committed
C++: NonConstantFormat
1 parent c94f12f commit 1dc93ac

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,17 @@ module NonConstFlowConfig implements DataFlow::ConfigSig {
169169
)
170170
}
171171

172-
predicate observeDiffInformedIncrementalMode() {
173-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 5 does not select a source or sink originating from the flow call on line 181 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql@184:53:184:56)
172+
predicate observeDiffInformedIncrementalMode() { any() }
173+
174+
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
175+
176+
Location getASelectedSinkLocation(DataFlow::Node sink) {
177+
result = sink.getLocation()
178+
or
179+
exists(FormattingFunctionCall call, Expr formatString | result = call.getLocation() |
180+
isSinkImpl(sink, formatString) and
181+
call.getArgument(call.getFormatParameterIndex()) = formatString
182+
)
174183
}
175184
}
176185

0 commit comments

Comments
 (0)