diff --git a/src/main/java/com/ibm/as400/access/AS400JDBCDriver.java b/src/main/java/com/ibm/as400/access/AS400JDBCDriver.java index d0371fabd..77bbed8b1 100644 --- a/src/main/java/com/ibm/as400/access/AS400JDBCDriver.java +++ b/src/main/java/com/ibm/as400/access/AS400JDBCDriver.java @@ -1105,8 +1105,9 @@ static AS400 initializeAS400(JDDataSourceURL dataSourceUrl, if(clearPassword!= null) //@pw1 { //@pw1 - /* check for *CURRENT */ - if (clearPassword[0] == '*' && + /* check for *CURRENT. Be sure to check the length */ + if (clearPassword.length == 8 && + clearPassword[0] == '*' && (clearPassword[1] == 'C' || clearPassword[1] == 'c') && (clearPassword[2] == 'U' || clearPassword[2] == 'u') && (clearPassword[3] == 'R' || clearPassword[3] == 'r') &&