Skip to content

Commit

Permalink
Fix NPE when using password in Properties
Browse files Browse the repository at this point in the history
Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm committed Jan 29, 2024
1 parent 94a4eb2 commit a24eb42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/ibm/as400/access/AS400JDBCDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -3832,9 +3832,11 @@ else if (JDProperties.isToolboxTraceSet(newProperties, null) == JDProperties.TRA
else if (propIndex == JDProperties.USER)
setUser(propertyValue);
else if (propIndex == JDProperties.PASSWORD) {
char[] clearPassword = properties_.getClearPassword();
char[] clearPassword = propertyValue.toCharArray();
setPassword(clearPassword);
CredentialVault.clearArray(clearPassword);
if (JDTrace.isTraceOn())
JDTrace.logInformation (this, "Use of password property not recommended: using setPassword(char[]) instead");
} else if (propIndex == JDProperties.SECURE)
setSecure(propertyValue.equals(TRUE_) ? true : false);
else if (propIndex == JDProperties.KEEP_ALIVE)
Expand Down

0 comments on commit a24eb42

Please sign in to comment.