zeroflag commented on a change in pull request #532:
URL: https://github.com/apache/knox/pull/532#discussion_r786866466



##########
File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/impl/JWTToken.java
##########
@@ -122,6 +129,10 @@ public JWTToken(String alg, String[] claimsArray, 
List<String> audiences, boolea
     jwt = new SignedJWT(header, claims);
   }
 
+  private String getClaimValue(String[] claims, int index) {
+    return claims == null || claims.length < index ? null : claims[index];

Review comment:
       There seems to be an off by one in the validation. Shouldn't this be 
`<=` ?
   
   ```java
   return claims == null || claims.length <= index ? null : claims[index];
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to