c
Default ruleset for C, curated by r2c.
Run Locally
Rules (6)

Variable '$VAR' was freed twice. This can lead to undefined behavior.

Avoid 'gets()'. This function does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' or 'gets_s()' instead.

Avoid using user-controlled format strings passed into 'sprintf', 'printf' and 'vsprintf'. These functions put you at risk of buffer overflow vulnerabilities through the use of format string exploits. Instead, use 'snprintf' and 'vsnprintf'.

Call to 'read()' without error checking is susceptible to file descriptor exhaustion. Consider using the 'getrandom()' function.

Variable '$VAR' was used after being freed. This can lead to undefined behavior.

Use %s, %d, %c... to format your variables, otherwise this could leak information.