From a4c075f03b597ac262c53d4e2f03072dd8d8f908 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 27 Feb 2023 16:25:32 +0000 Subject: [PATCH] C++: The data pointed to by 'gets' is also a source of user input. --- .../lib/semmle/code/cpp/models/implementations/Gets.qll | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll b/cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll index b89eb2c1f14..0a8d99c48a7 100644 --- a/cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll +++ b/cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll @@ -97,10 +97,11 @@ private class GetsFunction extends DataFlowFunction, ArrayFunction, AliasFunctio } override predicate hasLocalFlowSource(FunctionOutput output, string description) { - output.isParameterDeref(0) and - description = "string read by " + this.getName() - or - output.isReturnValue() and + ( + output.isParameterDeref(0) or + output.isReturnValue() or + output.isReturnValueDeref() + ) and description = "string read by " + this.getName() }