Skip to content
vetkitChecksChangelogDocumentation

vetkit.c.memory.return-local-address

A function returns the address of one of its own stack variables; the memory is invalid as soon as the function returns.

Last updated:

Suite: Security

c, cpp

A function returns the address of one of its own stack variables; the memory is invalid as soon as the function returns.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Return the data by value, write into a buffer supplied by the caller, or allocate it on the heap (and document who frees it).

References

Source: packages/engine/rules/sast/c.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.