gets is called

tx0/cpp:getsdefaultwarningreliability/memory-safetydepth fastbug, security, cwe-242

What it finds

gets(buf) reads a line of any length into a buffer of fixed size, so any input longer than the buffer overwrites what follows it. No use of it is safe, and C11 removed it; fgets takes the size of the buffer.

Only the C library's gets counts: a file that declares its own, or defines a macro of the name, is left alone.

From the rule's source, gets.rs.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:gets" = "off"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:gets] reason="..."

tx0 explain tx0/cpp:gets shows the same in the terminal. Found a false positive? Report it.