Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed to Applicability

...

Code Block
bgColor#CCCCFF
int privileges;

if (invalid_login()) {
  if (allow_guests()) {
    privileges = GUEST;
  } 
} else {
  privileges = ADMINISTRATOR;
}

Risk Assessment

Guideline

Severity

Likelihood

Remediation Cost

Priority

Level

EXP52-JG

medium

probable

medium

P8

L2

Related Guidelines

Applicability

Not enclosing the bodies of CERT C Secure Coding Standard: EXP19-C. Use braces for the body of an if, for, or while statement statements in braces makes code maintenance error prone.

Bibliography

[GNU 2010]

Coding Standards, Section 5.3, "Clean Use of C Constructs"

[Rogue 2000]

Rule 76: Use block statements instead of expression statements in control flow constructs

...