...
Code Block | ||
---|---|---|
| ||
/* First the options that are only allowed for root */ if (getuid() == 0 || geteuid() != 0) { /* ... */ } |
Compliant
...
Solution
A function pointer can be compared to a null function pointer of the same type.
...
Code Block | ||
---|---|---|
| ||
int do_xyz(void); if (do_xyz) { /* handle error */ } |
Compliant Solution
In this compliant solution, the function do_xyz()
is invoked and the return value is compared to 0.
...