We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
strlcpy
strlcat
1 parent 4ae35d1 commit 0b91310Copy full SHA for 0b91310
2 files changed
cpp/ql/lib/semmle/code/cpp/models/implementations/Strcat.qll
@@ -25,7 +25,8 @@ class StrcatFunction extends TaintFunction, DataFlowFunction, ArrayFunction, Sid
25
"_mbsncat", // _mbsncat(dst, src, max_amount)
26
"_mbsncat_l", // _mbsncat_l(dst, src, max_amount, locale)
27
"_mbsnbcat", // _mbsnbcat(dest, src, count)
28
- "_mbsnbcat_l" // _mbsnbcat_l(dest, src, count, locale)
+ "_mbsnbcat_l", // _mbsnbcat_l(dest, src, count, locale)
29
+ "strlcat" // strncat(dst, src, dst_size)
30
])
31
}
32
@@ -51,7 +52,7 @@ class StrcatFunction extends TaintFunction, DataFlowFunction, ArrayFunction, Sid
51
52
53
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
54
(
- this.getName() = ["strncat", "wcsncat", "_mbsncat", "_mbsncat_l"] and
55
+ this.getName() = ["strncat", "strlcat", "wcsncat", "_mbsncat", "_mbsncat_l"] and
56
input.isParameter(2)
57
or
58
this.getName() = ["_mbsncat_l", "_mbsnbcat_l"] and
cpp/ql/lib/semmle/code/cpp/models/implementations/Strcpy.qll
@@ -32,7 +32,8 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
"wcsxfrm_l", // _strxfrm_l(dest, src, max_amount, locale)
33
"_mbsnbcpy", // _mbsnbcpy(dest, src, max_amount)
34
"stpcpy", // stpcpy(dest, src)
35
- "stpncpy" // stpcpy(dest, src, max_amount)
+ "stpncpy", // stpcpy(dest, src, max_amount)
36
+ "strlcpy" // strlcpy(dst, src, dst_size)
37
38
39
@@ -60,7 +61,7 @@ class StrcpyFunction extends ArrayFunction, DataFlowFunction, TaintFunction, Sid
60
61
if this.isSVariant()
62
then result = 1
63
else (
- this.getName().matches(["%ncpy%", "%nbcpy%", "%xfrm%"]) and
64
+ this.getName().matches(["%ncpy%", "%nbcpy%", "%xfrm%", "%lcpy%"]) and
65
result = 2
66
)
67
0 commit comments