This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new a0eb55dcd8 Fix possible NPE a0eb55dcd8 is described below commit a0eb55dcd816a63dfb1ca0ba891e5f00e46e97f6 Author: remm <r...@apache.org> AuthorDate: Mon Sep 11 11:46:17 2023 +0200 Fix possible NPE Found by coverity. --- java/org/apache/catalina/realm/JAASMemoryLoginModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java index 94a4078f40..b1df1fc87e 100644 --- a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java +++ b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java @@ -265,7 +265,8 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { try { callbackHandler.handle(callbacks); username = ((NameCallback) callbacks[0]).getName(); - password = new String(((PasswordCallback) callbacks[1]).getPassword()); + char[] passwordArray = ((PasswordCallback) callbacks[1]).getPassword(); + password = (passwordArray == null) ? null : new String(passwordArray); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org