Skip to content

Commit d82ed6e

Browse files
committed
Add PointerArgumentToCstringFunctionIsInvalid.ql and create testref for it
1 parent f5454de commit d82ed6e

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

cpp/misra/src/rules/RULE-8-7-1/PointerArgumentToCstringFunctionIsInvalid.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
*/
1414

1515
import cpp
16-
import codingstandards.c.cert
17-
import codingstandards.c.OutOfBounds
16+
import codingstandards.cpp.OutOfBounds // for OOB::problems
17+
import codingstandards.cpp.Exclusions // for isExcluded(Element, Query)
18+
import codingstandards.cpp.exclusions.c.RuleMetadata
1819

1920
from
2021
OOB::BufferAccessLibraryFunctionCall fc, string message, Expr bufferArg, string bufferArgStr,
@@ -23,4 +24,3 @@ where
2324
not isExcluded(fc, OutOfBoundsPackage::libraryFunctionArgumentOutOfBoundsQuery()) and
2425
OOB::problems(fc, message, bufferArg, bufferArgStr, sizeOrOtherBufferArg, otherStr)
2526
select fc, message, bufferArg, bufferArgStr, sizeOrOtherBufferArg, otherStr
26-

cpp/misra/test/rules/RULE-8-7-1/PointerArgumentToCstringFunctionIsInvalid.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.

cpp/misra/test/rules/RULE-8-7-1/PointerArgumentToCstringFunctionIsInvalid.qlref

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c/cert/src/rules/ARR38-C/LibraryFunctionArgumentOutOfBounds.ql

0 commit comments

Comments
 (0)