[java-opensaml] branch main updated: Fix null detection issues.

Codeberg noreply at shibboleth.net
Tue May 12 13:40:39 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-opensaml.

View the commit online:
https://codeberg.org/Shibboleth/java-opensaml/commit/cabce3d9a1f2dae3657638747da661c2071d5d72

The following commit(s) were added to refs/heads/main by this push:
     new cabce3d9a Fix null detection issues.
cabce3d9a is described below

commit cabce3d9a1f2dae3657638747da661c2071d5d72
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue May 12 09:40:27 2026 -0400

    Fix null detection issues.
---
 .../opensaml/saml/saml1/binding/decoding/impl/HTTPPostDecoder.java   | 4 +++-
 .../opensaml/saml/saml2/binding/decoding/impl/HTTPPostDecoder.java   | 4 +++-
 .../saml/saml2/binding/decoding/impl/HTTPPostSimpleSignDecoder.java  | 5 ++++-
 .../saml/saml2/binding/decoding/impl/HTTPRedirectDeflateDecoder.java | 5 ++++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HTTPPostDecoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HTTPPostDecoder.java
index a83052bb4..18338eb10 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HTTPPostDecoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/binding/decoding/impl/HTTPPostDecoder.java
@@ -123,8 +123,10 @@ public class HTTPPostDecoder extends BaseSAMLHttpServletRequestDecoder implement
     @Override
     @Nullable
     protected Integer getMessageSize() throws MessageDecodingException {
+        final HttpServletRequest request = getHttpServletRequest();
+        assert request != null;
         return SAMLBindingSupport.getBase64Size(
-                getHttpServletRequest().getParameter(getMessageType().getParameterName()));
+                request.getParameter(getMessageType().getParameterName()));
     }
 
 }
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostDecoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostDecoder.java
index 43a8c5d16..48de786a1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostDecoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostDecoder.java
@@ -169,8 +169,10 @@ public class HTTPPostDecoder extends BaseSAMLHttpServletRequestDecoder implement
     @Override
     @Nullable
     protected Integer getMessageSize() throws MessageDecodingException {
+        final HttpServletRequest request = getHttpServletRequest();
+        assert request != null;
         return SAMLBindingSupport.getBase64Size(
-                getHttpServletRequest().getParameter(getMessageType().getParameterName()));
+                request.getParameter(getMessageType().getParameterName()));
     }
     
 }
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostSimpleSignDecoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostSimpleSignDecoder.java
index 4031d5376..f77f32194 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostSimpleSignDecoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPPostSimpleSignDecoder.java
@@ -145,10 +145,13 @@ public class HTTPPostSimpleSignDecoder extends HTTPPostDecoder {
     @Override
     protected void evaluateMessageSizeLimit() throws MessageDecodingException {
         super.evaluateMessageSizeLimit();
+
+        final HttpServletRequest request = getHttpServletRequest();
+        assert request != null;
         
         // Handle KeyInfo parameter, if present.
         // The support method will return size 0 if param doesn't exist or has a null or empty value.
-        final Integer keyInfoSize = SAMLBindingSupport.getBase64Size(getHttpServletRequest().getParameter("KeyInfo"));
+        final Integer keyInfoSize = SAMLBindingSupport.getBase64Size(request.getParameter("KeyInfo"));
         if (keyInfoSize > 0) {
             final boolean keyInfoEnabled = SAMLConfigurationSupport.isEnforceDecoderKeyInfoSizeLimit();
             final Integer keyInfoSizeLimit = SAMLConfigurationSupport.getDecoderKeyInfoSizeLimit();
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPRedirectDeflateDecoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPRedirectDeflateDecoder.java
index 02c4521d4..9093d2fb8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPRedirectDeflateDecoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPRedirectDeflateDecoder.java
@@ -334,8 +334,11 @@ public class HTTPRedirectDeflateDecoder extends BaseSAMLHttpServletRequestDecode
     @Override
     @Nullable
     protected Integer getMessageSize() throws MessageDecodingException {
+        final HttpServletRequest request = getHttpServletRequest();
+        assert request != null;
+
         return SAMLBindingSupport.getDeflatedSize(
-                getHttpServletRequest().getParameter(getMessageType().getParameterName()),
+                request.getParameter(getMessageType().getParameterName()),
                 SAMLConfigurationSupport.isDecoderEstimateInflatedSize(),
                 SAMLConfigurationSupport.getDecoderInflationFactor());
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list