-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
A check occurs on a file's attributes before the file is used in a privileged operation, but things may have changed
Defect 72298 (STATIC_C)
Checker TOCTOU (subcategory none)
File: /examples/mongoc-dump.c
Function mongoc_dump_collection
/examples/mongoc-dump.c, line: 64
Calling function "access" to perform check on "path".
if (0 == access (path, F_OK)) {
/examples/mongoc-dump.c, line: 65
Calling function "unlink" that uses "path" after a check function. This can cause a time-of-check, time-of-use race condition.
unlink (path);
File: /examples/mongoc-dump.c
Function mongoc_dump_collection
/examples/mongoc-dump.c, line: 64
Calling function "access" to perform check on "path".
if (0 == access (path, F_OK)) {
/examples/mongoc-dump.c, line: 69
Calling function "fopen" that uses "path" after a check function. This can cause a time-of-check, time-of-use race condition.
stream = fopen (path, "w");