Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1cf688 commit 3e6576bCopy full SHA for 3e6576b
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/pointer-deref/test.cpp
@@ -179,3 +179,13 @@ void test10_callee(array_t *arr) {
179
void test10(int size) {
180
test10_callee(mk_array_p(size));
181
}
182
+
183
+void deref_plus_one(char* q) {
184
+ char a = *(q + 1); // BAD [NOT DETECTED]
185
+}
186
187
+void test11(unsigned size) {
188
+ char *p = malloc(size);
189
+ char *q = p + size - 1;
190
+ deref_plus_one(q);
191
0 commit comments