ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [ws-wss4j] branch 2_3_x-fixes updated: Catch NFE in WSHandler
Date Mon, 13 Sep 2021 08:59:55 GMT
This is an automated email from the ASF dual-hosted git repository.

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


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

commit 1d202c1f671fc0756e7fbab0a006adc4f0577330
Author: Colm O hEigeartaigh <coheigea@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 fa217f6..a2f994b 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
@@ -529,8 +529,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());
+            }
         }
     }
 

Mime
View raw message