Tmpfile Tmpnam Tempnam

There exists a possible race condition in between the time that `tempnam` or `tmpnam` returns a pathname, and the time that the program opens it, another program might create that pathname using `open`, or create it as a symbolic link. Consider using the `mkstemp` function instead, but be aware it also contains possible risks. Ensure the process has called t

IndexedPublic repositoryMediumMedium confidenceVerifiedGPL-2.0-onlyC
greprules fetch gitlab-sast-c-tmpfile-rule-tmpnam-tempnam --engine opengrep

Description

There exists a possible race condition in between the time that `tempnam` or `tmpnam` returns a pathname, and the time that the program opens it, another program might create that pathname using `open`, or create it as a symbolic link. Consider using the `mkstemp` function instead, but be aware it also contains possible risks. Ensure the process has called t