You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/10/15 11:27:55 UTC

svn commit: r1708749 - /webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java

Author: coheigea
Date: Thu Oct 15 09:27:55 2015
New Revision: 1708749

URL: http://svn.apache.org/viewvc?rev=1708749&view=rev
Log:
[WSS-559] - NullPointerException in TimestampInputHandler.checkBSPCompliance

Modified:
    webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java

Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java?rev=1708749&r1=1708748&r2=1708749&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java Thu Oct 15 09:27:55 2015
@@ -149,7 +149,8 @@ public class TimestampInputHandler exten
             } catch (IllegalArgumentException e) {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, e);
             }
-            if (createdCalendar.getFractionalSecond().scale() > 3) {
+            if (createdCalendar.getFractionalSecond() != null 
+                && createdCalendar.getFractionalSecond().scale() > 3) {
                 securityContext.handleBSPRule(BSPRule.R3220);
             }
             if (createdCalendar.getSecond() > 59) {
@@ -173,7 +174,8 @@ public class TimestampInputHandler exten
             } catch (IllegalArgumentException e) {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, e);
             }
-            if (expiresCalendar.getFractionalSecond().scale() > 3) {
+            if (expiresCalendar.getFractionalSecond() != null
+                && expiresCalendar.getFractionalSecond().scale() > 3) {
                 securityContext.handleBSPRule(BSPRule.R3229);
             }
             if (expiresCalendar.getSecond() > 59) {