A string is copied or appended with a function that does not know the size of the destination

tx0/cpp:unbounded-string-copystrictwarningreliability/memory-safetydepth fastsecurity, cwe-120

What it finds

strcpy(dst, src) and strcat(dst, src) copy until the end of the source, however large the destination is; a longer source overwrites the memory after it. Functions that take the size, as snprintf or strlcpy, or a length checked before the copy, avoid that.

A copy of a string literal into an array the file declares with room for it is left alone.

From the rule's source, unbounded_string_copy.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:unbounded-string-copy" = "warning"

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:unbounded-string-copy] reason="..."

tx0 explain tx0/cpp:unbounded-string-copy shows the same in the terminal. Found a false positive? Report it.