Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
zha0cai committed Jun 21, 2024
1 parent f73b124 commit 1e1564e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public AttackResult registerNewUser(
String checkUserQuery =
"select userid from sql_challenge_users where userid = '" + username_reg + "'";
Statement statement = connection.createStatement();
// 这里执行了 sql 语句,但是后面并没有回显
ResultSet resultSet = statement.executeQuery(checkUserQuery);

if (resultSet.next()) {
Expand All @@ -75,6 +76,7 @@ public AttackResult registerNewUser(
attackResult = failed(this).feedback("user.exists").feedbackArgs(username_reg).build();
}
} else {
// 这里采用了预编译
PreparedStatement preparedStatement =
connection.prepareStatement("INSERT INTO sql_challenge_users VALUES (?, ?, ?)");
preparedStatement.setString(1, username_reg);
Expand Down

0 comments on commit 1e1564e

Please sign in to comment.