amarkevich commented on a change in pull request #534: 
cxf-rt-rs-security-oauth2: fix 'Potential null dereference'
URL: https://github.com/apache/cxf/pull/534#discussion_r271713276
 
 

 ##########
 File path: 
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/JPACodeDataProvider.java
 ##########
 @@ -143,13 +143,13 @@ public void setCodeLifetime(long codeLifetime) {
         if (c == null && resourceOwnerSubject == null) {
             return em.createQuery("SELECT c FROM ServerAuthorizationCodeGrant 
c",
                     ServerAuthorizationCodeGrant.class);
-        } else if (c == null) {
+        } else if (c == null && resourceOwnerSubject != null) {
 
 Review comment:
   there are 4 null/non-null combinations possible; added explicit check for 
all cases

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to