mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
22 lines
540 B
Plaintext
22 lines
540 B
Plaintext
/**
|
|
* @name Use of fgets()
|
|
* @description fgets() is dangerous to call. Use read_line() instead.
|
|
* @kind problem
|
|
* @problem.severity error
|
|
* @precision high
|
|
* @id cpp/fgets
|
|
* @tags reliability
|
|
* security
|
|
*/
|
|
import cpp
|
|
|
|
predicate dangerousFunction(Function function) {
|
|
exists (string name | name = function.getQualifiedName() |
|
|
name = "fgets")
|
|
}
|
|
|
|
from FunctionCall call, Function target
|
|
where call.getTarget() = target
|
|
and dangerousFunction(target)
|
|
select call, target.getQualifiedName() + " is potentially dangerous"
|