Skip to content

Commit 0d1884d

Browse files
committed
C++: Fix FP and accept test changes.
1 parent c2b1da0 commit 0d1884d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class ThrowingAllocator extends Function {
182182
// 3. the allocator isn't marked with `throw()` or `noexcept`.
183183
not exists(this.getBlock()) and
184184
not exists(Parameter p | p = this.getAParameter() |
185-
p.getUnspecifiedType() instanceof NoThrowType
185+
p.getUnspecifiedType().stripType() instanceof NoThrowType
186186
) and
187187
not this.isNoExcept() and
188188
not this.isNoThrow()

cpp/ql/test/query-tests/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
| test.cpp:151:9:151:24 | new | This allocation cannot throw. $@ is unnecessary. | test.cpp:152:15:152:18 | { ... } | This catch block |
1717
| test.cpp:199:15:199:35 | new | This allocation cannot throw. $@ is unnecessary. | test.cpp:201:16:201:19 | { ... } | This catch block |
1818
| test.cpp:212:14:212:34 | new | This allocation cannot throw. $@ is unnecessary. | test.cpp:213:34:213:36 | { ... } | This catch block |
19-
| test.cpp:233:12:233:36 | new | This allocation cannot return null. $@ is unnecessary. | test.cpp:234:6:234:17 | ... == ... | This check |

0 commit comments

Comments
 (0)