@@ -16,7 +16,8 @@ import cpp
16
16
import semmle.code.cpp.controlflow.Guards
17
17
18
18
/**
19
- * An operation on a filename.
19
+ * An operation on a filename that is likely to modify the corresponding file
20
+ * and may return an indication of success.
20
21
*
21
22
* Note: we're not interested in operations on file descriptors, as they
22
23
* are better behaved.
@@ -48,7 +49,8 @@ FunctionCall filenameOperation(Expr path) {
48
49
}
49
50
50
51
/**
51
- * A use of `access` (or similar) on a filename.
52
+ * An operation on a filename that returns information in the return value but
53
+ * does not modify the corresponding file. For example, `access`.
52
54
*/
53
55
FunctionCall accessCheck ( Expr path ) {
54
56
exists ( string name | name = result .getTarget ( ) .getName ( ) |
@@ -62,7 +64,9 @@ FunctionCall accessCheck(Expr path) {
62
64
}
63
65
64
66
/**
65
- * A use of `stat` (or similar) on a filename.
67
+ * An operation on a filename that returns information via a pointer argument
68
+ * and any return value, but does not modify the corresponding file. For
69
+ * example, `stat`.
66
70
*/
67
71
FunctionCall stat ( Expr path , Expr buf ) {
68
72
exists ( string name | name = result .getTarget ( ) .getName ( ) |
@@ -77,7 +81,7 @@ FunctionCall stat(Expr path, Expr buf) {
77
81
}
78
82
79
83
/**
80
- * Holds if `use` points to `source`, either by being the same or by
84
+ * Holds if `use` refers to `source`, either by being the same or by
81
85
* one step of variable indirection.
82
86
*/
83
87
predicate referenceTo ( Expr source , Expr use ) {
0 commit comments