Skip to content

Commit 2f576a4

Browse files
felickzatorralba
andauthored
test both arguments of getConnection
Co-authored-by: Tony Torralba <[email protected]>
1 parent b0c8992 commit 2f576a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/ql/test/query-tests/security/CWE-798/semmle/tests/HardcodedMSSQLCredentials.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class HardcodedMSSQLCredentials {
44
public static void main(SQLServerDataSource ds) throws Exception {
55
ds.setUser("Username"); // $ HardcodedCredentialsApiCall
66
ds.setPassword("password"); // $ HardcodedCredentialsApiCall
7-
ds.getConnection("Username", "password"); // $ HardcodedCredentialsApiCall
7+
ds.getConnection("Username", null); // $ HardcodedCredentialsApiCall
8+
ds.getConnection(null, "password"); // $ HardcodedCredentialsApiCall
89
}
910
}

0 commit comments

Comments
 (0)