Tmpfile GetTempFileName

The `GetTempFileName` function works by generating a randomly named file, creating the file (if it does not exist) and then closing it. An application wishing to use this temporary file will need to reopen this file to begin working with it. This leads to a potential Time Of Check Time Of Use (TOCTOU) vulnerability, as an attacker could replace or modify the

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

Description

The `GetTempFileName` function works by generating a randomly named file, creating the file (if it does not exist) and then closing it. An application wishing to use this temporary file will need to reopen this file to begin working with it. This leads to a potential Time Of Check Time Of Use (TOCTOU) vulnerability, as an attacker could replace or modify the