...
| Code Block | ||
|---|---|---|
| ||
enum { IN_STR_LEN=18, OUT_STR_LEN=20 };
|
Consequently, a programmer performing maintenance on this program would need to identify the relationship and modify both definitions accordingly. While this sort of error appears relatively benign, it could easily lead to serious security vulnerabilities such as buffer overflows.
...
| Code Block | ||
|---|---|---|
| ||
enum { IN_STR_LEN=18, OUT_STR_LEN=IN_STR_LEN+2 };
|
As a result, a programmer can reliably modify the program by changing the definition of IN_STR_LEN.
...
| Code Block | ||
|---|---|---|
| ||
enum { ADULT_AGE=18 };
enum { ALCOHOL_AGE=ADULT_AGE+3 }; /* misleading, relationship established when none exists */
|
Consequently, a programmer performing maintenance on this program may modify the definition for ADULT_AGE but fail to recognize that the definition for PURCHASE_ALCOHOL_AGE has also been changed as a consequence.
...
| Code Block | ||
|---|---|---|
| ||
enum { ADULT_AGE=18 };
enum { ALCOHOL_AGE=21 };
|
Risk Assessment
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
DCL08-A | 1 (low) | 1 (unlikely) | 2 (medium) | P2 | L3 |
...