Skip to content

Commit f9c724d

Browse files
authored
Merge pull request github#12325 from MathiasVP/gets-return-deref
C++: Make `gets` indirect output a LocalFlowSource
2 parents 9c202f5 + a4c075f commit f9c724d

File tree

1 file changed

+5
-4
lines changed
  • cpp/ql/lib/semmle/code/cpp/models/implementations

1 file changed

+5
-4
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ private class GetsFunction extends DataFlowFunction, ArrayFunction, AliasFunctio
9797
}
9898

9999
override predicate hasLocalFlowSource(FunctionOutput output, string description) {
100-
output.isParameterDeref(0) and
101-
description = "string read by " + this.getName()
102-
or
103-
output.isReturnValue() and
100+
(
101+
output.isParameterDeref(0) or
102+
output.isReturnValue() or
103+
output.isReturnValueDeref()
104+
) and
104105
description = "string read by " + this.getName()
105106
}
106107

0 commit comments

Comments
 (0)