Skip to content

Commit 0640b41

Browse files
committed
Adjust tests
1 parent b740cf9 commit 0640b41

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/ql/test/query-tests/security/CWE-807/semmle/tests/ConditionalBypassTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public static void main(HttpServletRequest request) throws Exception {
2929
if (adminCookie.getValue().equals("false")) // $ hasConditionalBypassTest
3030
login(user, password);
3131

32-
// FALSE POSITIVES: both methods are conditionally executed, but they probably
32+
// GOOD: both methods are conditionally executed, but they probably
3333
// both perform the security-critical action
34-
if (adminCookie.getValue() == "false") { // $ SPURIOUS: $ hasConditionalBypassTest
34+
if (adminCookie.getValue() == "false") { // Safe
3535
login(user, password);
3636
} else {
3737
reCheckAuth(user, password);
@@ -80,8 +80,8 @@ public static void test3(String user, String password) {
8080
else {
8181
// do something else
8282
// BAD: login may not happen
83-
return;
8483
}
84+
return;
8585
}
8686

8787
public static void test4(String user, String password) {

0 commit comments

Comments
 (0)