Skip to content

Commit 9b31b4e

Browse files
committed
CPP: Fix false positive.
1 parent 7b88bf7 commit 9b31b4e

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ predicate acquireExpr(Expr acquire, string kind) {
2121
exists(FunctionCall fc, Function f, string name |
2222
fc = acquire and
2323
f = fc.getTarget() and
24-
name = f.getName() and
24+
name = f.getQualifiedName() and
2525
(
2626
(
2727
name = "fopen" and
@@ -47,7 +47,7 @@ predicate releaseExpr(Expr release, Expr resource, string kind) {
4747
exists(FunctionCall fc, Function f, string name |
4848
fc = release and
4949
f = fc.getTarget() and
50-
name = f.getName() and
50+
name = f.getQualifiedName() and
5151
(
5252
(
5353
name = "fclose" and

cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79/AV Rule 79.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@
1919
| Variants.cpp:65:3:65:17 | ... = ... | Resource a is acquired by class MyClass6 but not released anywhere in this class. |
2020
| Variants.cpp:66:3:66:36 | ... = ... | Resource b is acquired by class MyClass6 but not released anywhere in this class. |
2121
| Variants.cpp:67:3:67:41 | ... = ... | Resource c is acquired by class MyClass6 but not released anywhere in this class. |
22-
| Variants.cpp:100:3:100:22 | ... = ... | Resource success is acquired by class myClass7Test but not released anywhere in this class. |
2322
| Wrapped.cpp:46:3:46:22 | ... = ... | Resource ptr2 is acquired by class Wrapped2 but not released anywhere in this class. |
2423
| Wrapped.cpp:59:3:59:22 | ... = ... | Resource ptr4 is acquired by class Wrapped2 but not released anywhere in this class. |

cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79/Variants.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class myClass7Test
9797
public:
9898
myClass7Test()
9999
{
100-
success = mc7.open(); // GOOD [FALSE POSITIVE]
100+
success = mc7.open(); // GOOD
101101
}
102102

103103
~myClass7Test()

0 commit comments

Comments
 (0)