The length passed with a buffer is the size of the pointer to it
What it finds
memset(p, 0, sizeof(p)), where p is a pointer: the length is the size of the pointer, not of what it points to, so only the first 4 or 8 bytes are written. The size of *p or of the buffer was meant.
The function must be the C library's: the file neither declares it nor defines it as a macro. The pointer must be declared in the file as a pointer, not as an array, and not as a pointer to a pointer, for which the two sizes agree.
From the rule's source, sizeof_pointer_length.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:
[rules]
"tx0/cpp:sizeof-pointer-length" = "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:sizeof-pointer-length] reason="..."tx0 explain tx0/cpp:sizeof-pointer-length shows the same in the terminal. Found a false positive? Report it.