We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3767ce5 commit cd4ec6cCopy full SHA for cd4ec6c
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/pointer-deref/test.cpp
@@ -700,4 +700,17 @@ void test34(unsigned size) {
700
if (p + 1 < end) {
701
int val = *p; // GOOD
702
}
703
-}
+}
704
+
705
+void deref(char* q) {
706
+ char x = *q; // $ MISSING: deref=L712->L706 deref=L713->L706
707
708
709
+void test35(unsigned long size, char* q)
710
+{
711
+ char* p = new char[size];
712
+ char* end = p + size; // $ alloc=L711
713
+ if(q <= end) {
714
+ deref(q);
715
+ }
716
0 commit comments