Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
langc
if (!(getuid() && geteuid() == 0)) {
  /* ... */
}

Risk Assessment

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP46-C

Low

Likely

Low

P9

L2

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.TYPE.IOTInappropriate operand type

Coverity

Include Page
Coverity_V
Coverity_V

CONSTANT_EXPRESSION_RESULT

Partially implemented

Klocwork
Include Page
Klocwork_V
Klocwork_V
MISRA.LOGIC.OPERATOR.NOT_BOOL
 

LDRA tool suite
Include Page
LDRA_V
LDRA_V
136 SFully Implemented
Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
MISRA2004-12_6_{a,b}Fully implemented
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
3344,4502
 

Cppcheck
Include Page
Cppcheck_V
Cppcheck_V
cert.pyDetected by the addon cert.py
 
PRQA CA-C++4.2 3709
 

PVS-Studio6.22V564General analysis rule

Related Guidelines

Key here (explains table format and definitions)

Taxonomy

Taxonomy item

Relationship

ISO/IEC TR 24772:2013Likely Incorrect Expression [KOA]Prior to 2018-01-12: CERT: Unspecified Relationship
CWE 2.11CWE-480, Use of incorrect operator2017-07-05: CERT: Rule subset of CWE
CWE 2.11CWE-5692017-07-06: CERT: Rule subset of CWE

CERT-CWE Mapping Notes

Key here for mapping notes

...

  • Usage of incorrect operator besides s/&/&&/ or s/|/||/


Bibliography

[Hatton 1995]Section 2.7.2, "Errors of Omission and Addition"

...


...