[java-identity-provider] 21/27: Add null check on service instance.

Scott Cantor cantor.2 at osu.edu
Fri May 3 14:32:11 EDT 2019


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

scantor pushed a commit to branch feature/IDP-1434
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=3a68b532baed9d9d3aef5671fddd70db1e477ba0

commit 3a68b532baed9d9d3aef5671fddd70db1e477ba0
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu May 2 09:37:57 2019 -0400

    Add null check on service instance.
---
 .../idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java  | 3 +++
 .../idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
index 06b14da..9a94785 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml1/profile/impl/AddAttributeStatementToAssertion.java
@@ -139,6 +139,9 @@ public class AddAttributeStatementToAssertion extends BaseAddAttributeStatementT
         ServiceableComponent<AttributeTranscoderRegistry> component = null;
         try {
             component = getTranscoderRegistry().getServiceableComponent();
+            if (component == null) {
+                throw new AttributeEncodingException("Attribute transoding service unavailable");
+            }
             for (final IdPAttribute attribute : Collections2.filter(attributes, Predicates.notNull())) {
                 encodeAttribute(component.getComponent(), profileRequestContext, attribute, encodedAttributes);
             }
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
index 502873c..d3e2f04 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/AddAttributeStatementToAssertion.java
@@ -141,6 +141,9 @@ public class AddAttributeStatementToAssertion extends BaseAddAttributeStatementT
         ServiceableComponent<AttributeTranscoderRegistry> component = null;
         try {
             component = getTranscoderRegistry().getServiceableComponent();
+            if (component == null) {
+                throw new AttributeEncodingException("Attribute transoding service unavailable");
+            }
             for (final IdPAttribute attribute : Collections2.filter(attributes, Predicates.notNull())) {
                 encodeAttribute(component.getComponent(), profileRequestContext, attribute, encodedAttributes);
             }

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


More information about the commits mailing list