Skip to content

Commit 4fdf4b2

Browse files
authored
Update DangerousWorksWithMultibyteOrWideCharacters.ql
1 parent 212b103 commit 4fdf4b2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-125/DangerousWorksWithMultibyteOrWideCharacters.ql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Dangerous use mbtowc.
3-
* @description Using function mbtowc with an invalid length argument can result in an out-of-bounds access error or unexpected result.
2+
* @name Dangerous use convert function.
3+
* @description Using convert function with an invalid length argument can result in an out-of-bounds access error or unexpected result.
44
* @kind problem
5-
* @id cpp/dangerous-use-mbtowc
5+
* @id cpp/dangerous-use-convert-function
66
* @problem.severity warning
77
* @precision medium
88
* @tags correctness
@@ -117,8 +117,7 @@ predicate findUseCharacterConversion(Expr exp, string msg) {
117117
predicate findUseMultibyteCharacter(Expr exp, string msg) {
118118
exists(ArrayType arrayType, ArrayExpr arrayExpr |
119119
arrayExpr = exp and
120-
arrayExpr.getArrayBase().getType() =
121-
arrayType and
120+
arrayExpr.getArrayBase().getType() = arrayType and
122121
(
123122
exists(AssignExpr assZero, SizeofExprOperator sizeofArray, Expr oneValue |
124123
oneValue.getValue() = "1" and

0 commit comments

Comments
 (0)