...
| Code Block | ||
|---|---|---|
| ||
#include <signal.h>
volatile size_t i;
void handler() {
i = 0;
}
int main(void) {
signal(SIGINT, handler);
i = 1;
while (i) {
/* do something */
}
}
|
Risk Assessment
Omitting the restrict qualification for objects that can change in ways unexpected to the implementation can lead to unexpected program flow or an inconsistent stateFailing to use the volatile qualifier can result in race conditions in asynchronous portions of the code, causing unexpected values to be stored, leading to possible data integrity violations.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
DCL34-C | 2 (medium) 2 | 1 (probableunlikely) | 2 (medium) | P8 P4 | L2 L3 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...