Add tests for out of bound access to arrays

This commit is contained in:
김선우
2025-01-29 12:04:07 +09:00
parent 7fe5ba84c7
commit 9fd2c67b4d
3 changed files with 73 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ public class LimboResultSet {
}
final Object[] resultSet = this.lastStepResult.getResult();
if (columnIndex > resultSet.length) {
if (columnIndex > resultSet.length || columnIndex < 0) {
throw new SQLException("columnIndex out of bound");
}

View File

@@ -57,7 +57,8 @@ public class JDBC4Statement implements Statement {
@Override
public ResultSet executeQuery(String sql) throws SQLException {
ensureOpen();
statement = this.withConnectionTimeout(
statement =
this.withConnectionTimeout(
() -> {
try {
// TODO: if sql is a readOnly query, do we still need the locks?