Skip to content

Commit 02c9272

Browse files
committed
Use DataFlow::Configuration and fix source in model answer
1 parent 407b7b4 commit 02c9272

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

workshop.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ import cpp
273273
import semmle.code.cpp.dataflow.DataFlow
274274
import DataFlow::PathGraph
275275
276-
class Config extends TaintTracking::Configuration {
276+
class Config extends DataFlow::Configuration {
277277
Config() { this = "Config: name doesn't matter" }
278278
279279
override predicate isSource(DataFlow::Node source) {
@@ -311,11 +311,12 @@ select sink, source, sink, "Memory is $@ and $@, causing a potential vulnerabili
311311
import semmle.code.cpp.dataflow.DataFlow
312312
import DataFlow::PathGraph
313313
314-
class Config extends TaintTracking::Configuration {
314+
class Config extends DataFlow::Configuration {
315315
Config() { this = "Config: name doesn't matter" }
316316
override predicate isSource(DataFlow::Node source) {
317317
exists(FunctionCall call |
318-
source.asDefiningArgument() = call.getArgument(0)
318+
source.asDefiningArgument() = call.getArgument(0) and
319+
call.getTarget().hasGlobalOrStdName("free")
319320
)
320321
}
321322
override predicate isSink(DataFlow::Node sink) {

0 commit comments

Comments
 (0)