This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new de49d5e457 Remove dead code
de49d5e457 is described below

commit de49d5e457854257e23294833d32a5de9b03caca
Author: remm <[email protected]>
AuthorDate: Wed May 20 14:00:13 2026 +0200

    Remove dead code
    
    Decoded cannot be null.
---
 .../apache/catalina/authenticator/BasicAuthenticator.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java 
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 57a781762b..27f511ea30 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -215,13 +215,14 @@ public class BasicAuthenticator extends AuthenticatorBase 
{
         private byte[] parseBase64() throws IllegalArgumentException {
             byte[] encoded = new byte[base64blobLength];
             System.arraycopy(authorization.getBuffer(), base64blobOffset, 
encoded, 0, base64blobLength);
-            byte[] decoded = Base64.getDecoder().decode(encoded);
-            // restore original offset
-            authorization.setStart(initialOffset);
-            if (decoded == null) {
-                throw new 
IllegalArgumentException(sm.getString("basicAuthenticator.notBase64"));
+            try {
+                byte[] decoded = Base64.getDecoder().decode(encoded);
+                // restore original offset
+                authorization.setStart(initialOffset);
+                return decoded;
+            } catch (IllegalArgumentException e) {
+                throw new 
IllegalArgumentException(sm.getString("basicAuthenticator.notBase64"), e);
             }
-            return decoded;
         }
 
         /*


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to