mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Update DangerousWorksWithMultibyteOrWideCharacters.ql
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @name Dangerous use mbtowc.
|
* @name Dangerous use convert function.
|
||||||
* @description Using function mbtowc with an invalid length argument can result in an out-of-bounds access error or unexpected result.
|
* @description Using convert function with an invalid length argument can result in an out-of-bounds access error or unexpected result.
|
||||||
* @kind problem
|
* @kind problem
|
||||||
* @id cpp/dangerous-use-mbtowc
|
* @id cpp/dangerous-use-convert-function
|
||||||
* @problem.severity warning
|
* @problem.severity warning
|
||||||
* @precision medium
|
* @precision medium
|
||||||
* @tags correctness
|
* @tags correctness
|
||||||
@@ -117,8 +117,7 @@ predicate findUseCharacterConversion(Expr exp, string msg) {
|
|||||||
predicate findUseMultibyteCharacter(Expr exp, string msg) {
|
predicate findUseMultibyteCharacter(Expr exp, string msg) {
|
||||||
exists(ArrayType arrayType, ArrayExpr arrayExpr |
|
exists(ArrayType arrayType, ArrayExpr arrayExpr |
|
||||||
arrayExpr = exp and
|
arrayExpr = exp and
|
||||||
arrayExpr.getArrayBase().getType() =
|
arrayExpr.getArrayBase().getType() = arrayType and
|
||||||
arrayType and
|
|
||||||
(
|
(
|
||||||
exists(AssignExpr assZero, SizeofExprOperator sizeofArray, Expr oneValue |
|
exists(AssignExpr assZero, SizeofExprOperator sizeofArray, Expr oneValue |
|
||||||
oneValue.getValue() = "1" and
|
oneValue.getValue() = "1" and
|
||||||
|
|||||||
Reference in New Issue
Block a user