[java-idp-plugin-duo] branch dev/maint-1 updated: Add NPE check to http response and status line

Phil Smart philip.smart at jisc.ac.uk
Wed Sep 6 12:32:14 UTC 2023


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

philsmart pushed a commit to branch dev/maint-1
in repository java-idp-plugin-duo.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=9c93f483d73117ca4403e68f7d06bfdbab72f95d

The following commit(s) were added to refs/heads/dev/maint-1 by this push:
     new 9c93f48  Add NPE check to http response and status line
9c93f48 is described below

commit 9c93f483d73117ca4403e68f7d06bfdbab72f95d
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Sep 6 13:32:11 2023 +0100

    Add NPE check to http response and status line
---
 .../net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
index d9fa7fe..52e3ec2 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClient.java
@@ -235,6 +235,9 @@ public final class NimbusClient extends AbstractDuoOIDCClient {
             httpResponse = httpClient.execute(request, clientContext);
             HttpClientSecuritySupport.checkTLSCredentialEvaluated(clientContext, request.getURI().getScheme());
 
+            if (httpResponse == null || httpResponse.getStatusLine() == null) {
+                throw new DuoClientException("No response or response status returned by Duo"); 
+            }
             final int httpStatusCode = httpResponse.getStatusLine().getStatusCode();
             if (httpStatusCode != HttpStatus.SC_OK) {
                 // dump the body for logging - if one exists

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


More information about the commits mailing list