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 bfc95c6 commit 1d8d45bCopy full SHA for 1d8d45b
1 file changed
cpp/ql/src/Critical/NotInitialised.ql
@@ -54,6 +54,7 @@ predicate undefinedLocalUse(VariableAccess va) {
54
// it is hard to tell when a struct or array has been initialized, so we
55
// ignore them
56
not isAggregateType(lv.getUnderlyingType()) and
57
+ not lv.isStatic() and // static variables are initialized to zero or null by default
58
not lv.getType().hasName("va_list") and
59
va = lv.getAnAccess() and
60
noDefPath(lv, va) and
@@ -70,7 +71,8 @@ predicate uninitialisedGlobal(GlobalVariable gv) {
70
71
va = gv.getAnAccess() and
72
va.isRValue() and
73
not gv.hasInitializer() and
- not gv.hasSpecifier("extern")
74
+ not gv.hasSpecifier("extern") and
75
+ not gv.isStatic() // static variables are initialized to zero or null by default
76
)
77
}
78
0 commit comments