Usage of deprecated function (usleep)
Description
The `usleep` function has been deprecated, use `nanosleep` or `setitimer` instead. For more information please see: https://linux.die.net/man/3/setitimer
Examples
Insecure Code
c
usleep(1000);Secure Code
c
nanosleep(&((struct timespec){1, 0}), NULL);Remediation
Replace `usleep` with `nanosleep` or `setitimer`
Rule Details
| Field | Value |
|---|---|
| ID | CODE-0605 |
| Category | InsecureConfig |
| Severity | LOW |
| CWE | CWE-676 |
| Confidence | HIGH |
| Impact | LOW |
| Likelihood | LOW |
| Exploitability | COMPLEX |
| Tags | deprecated function, usleep |
| OWASP | A9:2017-Using Components with Known Vulnerabilities, A06:2021-Vulnerable and Outdated Components |