gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: fix use before init


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: fix use before initialization
Date: Tue, 01 Oct 2019 19:53:09 +0200

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

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new a8a5115  fix use before initialization
a8a5115 is described below

commit a8a5115d2c526b33b8f92e5cca94802c34e19298
Author: Florian Dold <address@hidden>
AuthorDate: Tue Oct 1 19:53:02 2019 +0200

    fix use before initialization
---
 src/backend/taler-merchant-httpd_check-payment.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_check-payment.c 
b/src/backend/taler-merchant-httpd_check-payment.c
index a77e731..fc6cd15 100644
--- a/src/backend/taler-merchant-httpd_check-payment.c
+++ b/src/backend/taler-merchant-httpd_check-payment.c
@@ -216,7 +216,6 @@ send_pay_request (struct MHD_Connection *connection,
  * @param mi the merchant's instance
  * @param final_contract_url where to redirect for the contract
  * @param session_id the session_id
- * @param fulfillment_url fulfillment URL of the contract
  * @param order_id the order to look up
  * @return #MHD_YES on success
  */
@@ -225,7 +224,6 @@ check_order_and_request_payment (struct MHD_Connection 
*connection,
                                  struct MerchantInstance *mi,
                                  const char *final_contract_url,
                                  const char *session_id,
-                                 const char *fulfillment_url,
                                  const char *order_id)
 {
   enum GNUNET_DB_QueryStatus qs;
@@ -233,6 +231,7 @@ check_order_and_request_payment (struct MHD_Connection 
*connection,
   struct GNUNET_HashCode h_contract_terms;
   char *h_contract_terms_str;
   int ret;
+  const char *fulfillment_url;
 
   qs = db->find_order (db->cls,
                        &contract_terms,
@@ -255,6 +254,21 @@ check_order_and_request_payment (struct MHD_Connection 
*connection,
                                          
TALER_EC_CHECK_PAYMENT_ORDER_ID_UNKNOWN,
                                          "unknown order_id");
   }
+  {
+    struct GNUNET_JSON_Specification spec[] = {
+      GNUNET_JSON_spec_string ("fulfillment_url", &fulfillment_url),
+      GNUNET_JSON_spec_end ()
+    };
+
+    if (GNUNET_OK != GNUNET_JSON_parse (contract_terms, spec, NULL, NULL))
+    {
+      GNUNET_break (0);
+      json_decref (contract_terms);
+      return TMH_RESPONSE_reply_internal_error (connection,
+                                                
TALER_EC_CHECK_PAYMENT_DB_FETCH_CONTRACT_TERMS_ERROR,
+                                                "Merchant database error 
(contract terms corrupted)");
+    }
+  }
   if (GNUNET_OK !=
       TALER_JSON_hash (contract_terms,
                        &h_contract_terms))
@@ -372,7 +386,6 @@ MH_handler_check_payment (struct TMH_RequestHandler *rh,
                                            mi,
                                            final_contract_url,
                                            session_id,
-                                           fulfillment_url,
                                            order_id);
     GNUNET_free (final_contract_url);
     return ret;
@@ -391,6 +404,7 @@ MH_handler_check_payment (struct TMH_RequestHandler *rh,
 
     if (GNUNET_OK != GNUNET_JSON_parse (contract_terms, spec, NULL, NULL))
     {
+      GNUNET_break (0);
       GNUNET_free (final_contract_url);
       json_decref (contract_terms);
       return TMH_RESPONSE_reply_internal_error (connection,

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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