gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 04/08: fix NULL termination of fee list


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 04/08: fix NULL termination of fee list
Date: Sun, 15 Apr 2018 12:20:48 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit 8ebb4cda07f92f217f3388eaccabf9589fdb0800
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 2 16:35:14 2018 +0200

    fix NULL termination of fee list
---
 src/exchange-lib/exchange_api_wire.c     |  4 +++-
 src/exchange-tools/taler-exchange-wire.c | 11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/exchange-lib/exchange_api_wire.c 
b/src/exchange-lib/exchange_api_wire.c
index 12789b2..6537e6c 100644
--- a/src/exchange-lib/exchange_api_wire.c
+++ b/src/exchange-lib/exchange_api_wire.c
@@ -167,8 +167,10 @@ parse_fees (json_t *fees)
         free_fees (fm);
         return NULL;
       }
-      if (idx < len)
+      if (idx + 1 < len)
         wa->next = &fe->fee_list[idx + 1];
+      else
+        wa->next = NULL;
     }
   }
   return fm;
diff --git a/src/exchange-tools/taler-exchange-wire.c 
b/src/exchange-tools/taler-exchange-wire.c
index 390c0e5..6daf3de 100644
--- a/src/exchange-tools/taler-exchange-wire.c
+++ b/src/exchange-tools/taler-exchange-wire.c
@@ -76,6 +76,16 @@ sign_account_data (void *cls,
                          JSON_INDENT(2));
   json_decref (wire);
   GNUNET_assert (NULL != json_out);
+  if (GNUNET_OK !=
+      GNUNET_DISK_directory_create_for_file (ai->wire_response_filename))
+  {
+    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+                              "mkdir",
+                              ai->wire_response_filename);
+    global_ret = 1;
+    free (json_out);
+    return;
+  }
 
   out = fopen (ai->wire_response_filename,
                "w+");
@@ -85,6 +95,7 @@ sign_account_data (void *cls,
                               "fopen",
                               ai->wire_response_filename);
     global_ret = 1;
+    free (json_out);
     return;
   }
   fprintf (out,

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



reply via email to

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