Skip to content

Commit 56b9566

Browse files
committed
C++: Fix mistakes in models of internal strcat and strcpy functions.
1 parent f163d01 commit 56b9566

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ class StrcatFunction extends TaintFunction, DataFlowFunction, ArrayFunction, Sid
5858

5959
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
6060
(
61-
this.getName() =
62-
[
63-
"strncat", "wcsncat", "_mbsncat", "_mbsncat_l", "__builtin___strncat_chk",
64-
"__builtin___strcat_chk"
65-
] and
61+
this.getName() = ["strncat", "wcsncat", "_mbsncat", "_mbsncat_l", "__builtin___strncat_chk"] and
6662
input.isParameter(2)
6763
or
6864
this.getName() = ["_mbsncat_l", "_mbsnbcat_l"] and

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
7373
if this.isSVariant()
7474
then result = 1
7575
else (
76-
this.getName()
77-
.matches([
78-
"%ncpy%", "%nbcpy%", "%xfrm%", "strlcpy", "__builtin___strcpy_chk",
79-
"__builtin___stpcpy_chk", "__builtin___stpncpy_chk", "__builtin___strncpy_chk"
80-
]) and
76+
this.getName().matches(["%ncpy%", "%nbcpy%", "%xfrm%", "strlcpy"]) and
8177
result = 2
8278
)
8379
}

0 commit comments

Comments
 (0)