Skip to content

Commit ec7ed15

Browse files
committed
Replace calls to getConstCharTPointer with getValueType
1 parent 7379cac commit ec7ed15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/common/src/codingstandards/cpp/rules/containeraccesswithoutrangecheck/ContainerAccessWithoutRangeCheck.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class StringContainerConstructorCall extends ContainerConstructorCall {
159159
override Expr getInitialContainerSizeExpr() {
160160
// from buffer
161161
c.getNumberOfParameters() = 3 and
162-
c.getParameter(0).getType() = stringInstantiation.getConstCharTPointer() and
162+
c.getParameter(0).getType() = stringInstantiation.getValueType() and
163163
c.getParameter(1).getType() = stringInstantiation.getSizeType() and
164164
c.getParameter(2).getType() = stringInstantiation.getConstAllocatorReferenceType() and
165165
// copies `n` items from the buffer
@@ -181,7 +181,7 @@ class StringContainerConstructorCall extends ContainerConstructorCall {
181181
or
182182
// from c-string constructor
183183
c.getNumberOfParameters() = 2 and
184-
c.getParameter(0).getType() = stringInstantiation.getConstCharTPointer() and
184+
c.getParameter(0).getType() = stringInstantiation.getValueType() and
185185
c.getParameter(1).getType() = stringInstantiation.getConstAllocatorReferenceType() and
186186
result = getArgument(0).getValue().length()
187187
or

0 commit comments

Comments
 (0)