We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0584aee + 0e6936d commit 5e92763Copy full SHA for 5e92763
cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll
@@ -49,7 +49,11 @@ private Class getRootType(FieldAccess fa) {
49
exists(VariableAccess root |
50
root = fa.getQualifier+() and
51
not exists(root.getQualifier()) and
52
- result = root.getUnspecifiedType()
+ // We strip the type because the root may be a pointer. For example `p` in:
53
+ // struct S { char buffer[10]; };
54
+ // S* p = ...;
55
+ // strcpy(p->buffer, "abc");
56
+ result = root.getUnspecifiedType().stripType()
57
)
58
}
59
0 commit comments