Skip to content

Commit c8a4a8b

Browse files
authored
Update InsecureTemporaryFile.ql
1 parent 2574aa8 commit c8a4a8b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-377/InsecureTemporaryFile.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ predicate numberArgumentWrite(Function f, int apos) {
3939

4040
from FunctionCall fc, string msg
4141
where
42+
// search for functions for generating a name, without a guarantee of the absence of a file during the period of work with it.
4243
(
4344
fc.getTarget().hasGlobalOrStdName("tmpnam") or
4445
fc.getTarget().hasGlobalOrStdName("tmpnam_s") or
@@ -53,6 +54,7 @@ where
5354
msg =
5455
"Finding the name of a file that does not exist does not mean that it will not be exist at the next operation."
5556
or
57+
// finding places to work with a file without setting permissions, but with predictable names.
5658
(
5759
fc.getTarget().hasGlobalOrStdName("fopen") or
5860
fc.getTarget().hasGlobalOrStdName("open")

0 commit comments

Comments
 (0)