...
| Code Block | ||||
|---|---|---|---|---|
| ||||
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 |
|
| Supported, but no explicit checker | |||||||||
| CodeSonar |
| LANG.TYPE.IOT | Inappropriate operand type | ||||||
| CONSTANT_EXPRESSION_RESULT | Partially implemented | |||||||
| Klocwork |
| MISRA.LOGIC.OPERATOR.NOT_BOOL |
| LDRA tool suite |
| 136 S | Fully Implemented | ||||||
| Parasoft C/C++test |
|
|
| MISRA2004-12_6_{a,b} | Fully implemented | ||||||
| PRQA QA-C |
| 3344,4502 |
| Cppcheck |
| cert.py | Detected by the addon cert.py |
| PRQA CA-C++ | 4.2 | 3709 |
| PVS-Studio | 6.22 | V564 | General analysis rule |
Related Guidelines
Key here (explains table format and definitions)
Taxonomy | Taxonomy item | Relationship |
|---|---|---|
| ISO/IEC TR 24772:2013 | Likely Incorrect Expression [KOA] | Prior to 2018-01-12: CERT: Unspecified Relationship |
| CWE 2.11 | CWE-480, Use of incorrect operator | 2017-07-05: CERT: Rule subset of CWE |
| CWE 2.11 | CWE-569 | 2017-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" |
...
...