gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-challenger] branch master updated: handle scope being NULL


From: gnunet
Subject: [taler-challenger] branch master updated: handle scope being NULL
Date: Thu, 02 Nov 2023 20:16:04 +0100

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

grothoff pushed a commit to branch master
in repository challenger.

The following commit(s) were added to refs/heads/master by this push:
     new 9f4dbbb  handle scope being NULL
9f4dbbb is described below

commit 9f4dbbb26583a066f16854638cceecaa4d29276c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Nov 2 20:16:00 2023 +0100

    handle scope being NULL
---
 src/challenger/challenger-httpd_common.c |  4 +++-
 src/challenger/challenger-httpd_token.c  | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/challenger/challenger-httpd_common.c 
b/src/challenger/challenger-httpd_common.c
index 84b4f5e..e9bb937 100644
--- a/src/challenger/challenger-httpd_common.c
+++ b/src/challenger/challenger-httpd_common.c
@@ -75,11 +75,13 @@ CH_compute_code (const struct CHALLENGER_ValidationNonceP 
*nonce,
                                     client_secret,
                                     strlen (client_secret),
                                     client_scope,
-                                    strlen (client_scope),
                                     address,
                                     strlen (address),
                                     client_redirect_uri,
                                     strlen (client_redirect_uri),
+                                    NULL != client_scope
+                                    ? strlen (client_scope)
+                                    : 0,
                                     NULL,
                                     0));
   ns = GNUNET_STRINGS_data_to_string_alloc (nonce,
diff --git a/src/challenger/challenger-httpd_token.c 
b/src/challenger/challenger-httpd_token.c
index 3985d21..ff24346 100644
--- a/src/challenger/challenger-httpd_token.c
+++ b/src/challenger/challenger-httpd_token.c
@@ -390,6 +390,21 @@ CH_handler_token (struct CH_HandlerContext *hc,
     case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
       break;
     }
+    if (NULL == address)
+    {
+      GNUNET_break_op (0);
+      GNUNET_free (address);
+      GNUNET_free (client_scope);
+      GNUNET_free (client_secret);
+      GNUNET_free (client_redirect_uri);
+      GNUNET_free (client_state);
+      return TALER_MHD_reply_with_oauth_error (
+        hc->connection,
+        MHD_HTTP_CONFLICT,
+        "invalid_request",
+        TALER_EC_CHALLENGER_MISSING_ADDRESS,
+        "code");
+    }
     code = CH_compute_code (&bc->nonce,
                             client_secret,
                             client_scope,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]