...
Code Block | ||
---|---|---|
| ||
/* First the options that are only allowed for root */ if (getuid() == 0 || geteuid() != 0) { /* ... */ } |
Compliant Code Example
A function pointer can be compared to a null function pointer of the same type.
Code Block | ||
---|---|---|
| ||
/* First the options that are only allowed for root */
if (getuid == (uid_t(*)(void))0 || geteuid != (uid_t(*)(void))0) {
/* ... */
}
|
This code should not be diagnosed by an analyzer.
Noncompliant Code Example
...