...
| Code Block | ||
|---|---|---|
| ||
struct bf {
unsigned int m1 : 6;
unsigned int m2 : 4;
};
void function() {
struct bf data;
data.m1 = 0;
data.m2 = 0;
data.m2 += 1;
}
|
Risk Assessment
Making invalid assumptions about the type of type-cast data, especially bit-fields, can result in unexpected data values.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
EXP11-C | medium | probable | medium | P8 | L2 |
Automated Detection
Compass/ROSE can detect violations of this rule. Specifically, it reports violations if:
- A pointer to one object is type cast to the pointer of a different object
- The pointed-to object of the (type cast) pointer is then modified arithmetically.
Risk Assessment
...
- .
...
Recommendation
...
Severity
...
Likelihood
...
Remediation Cost
...
Priority
...
Level
...
EXP11-C
...
medium
...
probable
...
medium
...
P8
...
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...