...
This compliant solution uses the identifier assigned to the constant value in the expression.:
Code Block |
---|
|
#include <stdio.h>
/* ... */
nblocks = 1 + (nbytes - 1) / BUFSIZ;
|
...
Assuming the value of an expression diminishes the maintainability of code and can produce unexpected behavior under any circumstances in which the constant changes.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|
EXP07-C |
lowunlikelymediumAutomated Detection
Tool | Version | Checker | Description |
---|
LDRA tool suite |
---|
| Axivion Bauhaus Suite_V |
---|
| Axivion Bauhaus Suite |
---|
|
|
LDRALDRA201 S | Fully implemented | PRQA QA-CPRQAPRQA3120 | Partially ImplementedRelated Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
Bibliography
...
Image Modified Image Modified Image Modified