Skip to content

Commit c5ed859

Browse files
committed
C++: Update test comments to my best understanding.
1 parent dc2cb9b commit c5ed859

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-367/semmle/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void test1()
1818
create(file1);
1919
if (!rename(file1, file2))
2020
{
21-
remove(file1); // BAD
21+
remove(file1); // DUBIOUS (bad but perhaps not exploitable) [REPORTED]
2222
}
2323
}
2424

@@ -46,6 +46,6 @@ void test3()
4646
create(file1);
4747
if (!rename(file1, file2))
4848
{
49-
remove(file1); // BAD
49+
remove(file1); // DUBIOUS (bad but perhaps not exploitable) [REPORTED]
5050
}
5151
}

cpp/ql/test/query-tests/Security/CWE/CWE-367/semmle/test2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void test3_1(const char *path, int arg)
207207
int f;
208208

209209
f = open(path, arg);
210-
if (stat(path, &buf)) // BAD??? [NOT DETECTED]
210+
if (stat(path, &buf)) // BAD [NOT DETECTED]
211211
{
212212
// ...
213213
}
@@ -242,7 +242,7 @@ void test4_1(const char *path)
242242

243243
fclose(f);
244244

245-
chmod(path, 0); // BAD???
245+
chmod(path, 0); // DUBIOUS (bad but perhaps not exploitable) [REPORTED]
246246
}
247247
}
248248

@@ -252,7 +252,7 @@ void test5_1(const char *path1, const char *path2)
252252
{
253253
if (!rename(path1, path2))
254254
{
255-
remove(path1); // BAD???
255+
remove(path1); // DUBIOUS (bad but perhaps not exploitable) [REPORTED]
256256
}
257257
}
258258

@@ -262,7 +262,7 @@ void test5_2(const char *path1, const char *path2)
262262

263263
if (rename(path1, path2))
264264
{
265-
f = fopen(path2, "r"); // BAD??? [NOT DETECTED]
265+
f = fopen(path2, "r"); // BAD [NOT DETECTED]
266266
}
267267
}
268268

@@ -289,7 +289,7 @@ void test6_2(const char *path)
289289
// ...
290290
}
291291

292-
f = fopen(path, "r"); // GOOD (doesn't depend on the access check)
292+
f = fopen(path, "r"); // GOOD (appears not to be intended to depend on the access check)
293293

294294
// ...
295295
}

0 commit comments

Comments
 (0)