Skip to content

Commit 87ad519

Browse files
authored
Merge pull request github#3569 from geoffw0/strftime
C++: Taint flow consistency change for strftime
2 parents 1fea545 + 6fcfd03 commit 87ad519

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cpp/ql/src/semmle/code/cpp/models/implementations/Strftime.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ class Strftime extends TaintFunction, ArrayFunction {
1010
input.isParameterDeref(2) or
1111
input.isParameterDeref(3)
1212
) and
13-
(
14-
output.isParameterDeref(0) or
15-
output.isReturnValue()
16-
)
13+
output.isParameterDeref(0)
1714
}
1815

1916
override predicate hasArrayWithNullTerminator(int bufParam) { bufParam = 2 }

cpp/ql/src/semmle/code/cpp/models/interfaces/Taint.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import semmle.code.cpp.models.Models
1515
* A library function for which a taint-tracking library should propagate taint
1616
* from a parameter or qualifier to an output buffer, return value, or qualifier.
1717
*
18+
* An expression is tainted if it could be influenced by an attacker to have
19+
* an unusual value.
20+
*
1821
* Note that this does not include direct copying of values; that is covered by
1922
* DataFlowModel.qll. If a value is sometimes copied in full, and sometimes
2023
* altered (for example copying a string with `strncpy`), this is also considered

0 commit comments

Comments
 (0)