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 2021/09/13 09:00:14 UTC

[ws-wss4j] branch 2_2_x-fixes updated: Catch NFE in WSHandler

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

coheigea pushed a commit to branch 2_2_x-fixes
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git


The following commit(s) were added to refs/heads/2_2_x-fixes by this push:
     new cd0dbd3  Catch NFE in WSHandler
cd0dbd3 is described below

commit cd0dbd3293dda4bc0f19c88d8803430b992fc1f3
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Sep 13 09:53:47 2021 +0100

    Catch NFE in WSHandler
---
 .../src/main/java/org/apache/wss4j/dom/handler/WSHandler.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java b/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
index a2a67df..73a7746 100644
--- a/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
+++ b/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
@@ -527,8 +527,12 @@ public abstract class WSHandler {
 
         String iterations = getString(WSHandlerConstants.DERIVED_KEY_ITERATIONS, mc);
         if (iterations != null) {
-            int iIterations = Integer.parseInt(iterations);
-            reqData.setDerivedKeyIterations(iIterations);
+            try {
+                int iIterations = Integer.parseInt(iterations);
+                reqData.setDerivedKeyIterations(iIterations);
+            } catch (NumberFormatException e) {
+                LOG.warn("Error in configuring a derived key iteration count: " + e.getMessage());
+            }
         }
     }