gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: fix 0-length VLAs


From: gnunet
Subject: [taler-merchant] branch master updated: fix 0-length VLAs
Date: Wed, 10 May 2023 00:57:02 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 32f00d5c fix 0-length VLAs
32f00d5c is described below

commit 32f00d5c4809c7da86ec1b433dc1e2d6f9598d9b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed May 10 00:57:00 2023 +0200

    fix 0-length VLAs
---
 src/lib/merchant_api_get_orders.c            |  2 +-
 src/lib/merchant_api_get_products.c          |  2 +-
 src/lib/merchant_api_merchant_get_order.c    |  6 +++---
 src/testing/testing_api_cmd_post_instances.c |  6 +++---
 src/testing/testing_api_cmd_testserver.c     | 12 ++++++------
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/lib/merchant_api_get_orders.c 
b/src/lib/merchant_api_get_orders.c
index 7f08acb6..0a0ba3f0 100644
--- a/src/lib/merchant_api_get_orders.c
+++ b/src/lib/merchant_api_get_orders.c
@@ -76,7 +76,7 @@ parse_orders (const json_t *ia,
               struct TALER_MERCHANT_OrdersGetHandle *ogh)
 {
   unsigned int oes_len = json_array_size (ia);
-  struct TALER_MERCHANT_OrderEntry oes[oes_len];
+  struct TALER_MERCHANT_OrderEntry oes[GNUNET_NZL (oes_len)];
   size_t index;
   json_t *value;
   int ret;
diff --git a/src/lib/merchant_api_get_products.c 
b/src/lib/merchant_api_get_products.c
index ce26b496..d13faf2d 100644
--- a/src/lib/merchant_api_get_products.c
+++ b/src/lib/merchant_api_get_products.c
@@ -78,7 +78,7 @@ parse_products (const json_t *json,
                 struct TALER_MERCHANT_ProductsGetHandle *pgh)
 {
   unsigned int ies_len = json_array_size (ia);
-  struct TALER_MERCHANT_InventoryEntry ies[ies_len];
+  struct TALER_MERCHANT_InventoryEntry ies[GNUNET_NZL (ies_len)];
   size_t index;
   json_t *value;
   enum GNUNET_GenericReturnValue ret;
diff --git a/src/lib/merchant_api_merchant_get_order.c 
b/src/lib/merchant_api_merchant_get_order.c
index 0e6b53bf..68631bde 100644
--- a/src/lib/merchant_api_merchant_get_order.c
+++ b/src/lib/merchant_api_merchant_get_order.c
@@ -231,9 +231,9 @@ handle_paid (struct TALER_MERCHANT_OrderMerchantGetHandle 
*omgh,
     unsigned int wts_len = json_array_size (wire_details);
     unsigned int wrs_len = json_array_size (wire_reports);
     unsigned int ref_len = json_array_size (refund_details);
-    struct TALER_MERCHANT_WireTransfer wts[wts_len];
-    struct TALER_MERCHANT_WireReport wrs[wrs_len];
-    struct TALER_MERCHANT_RefundOrderDetail ref[ref_len];
+    struct TALER_MERCHANT_WireTransfer wts[GNUNET_NZL (wts_len)];
+    struct TALER_MERCHANT_WireReport wrs[GNUNET_NZL (wrs_len)];
+    struct TALER_MERCHANT_RefundOrderDetail ref[GNUNET_NZL (ref_len)];
 
     for (unsigned int i = 0; i<wts_len; i++)
     {
diff --git a/src/testing/testing_api_cmd_post_instances.c 
b/src/testing/testing_api_cmd_post_instances.c
index 4938f6c0..411063af 100644
--- a/src/testing/testing_api_cmd_post_instances.c
+++ b/src/testing/testing_api_cmd_post_instances.c
@@ -322,9 +322,9 @@ TALER_TESTING_cmd_merchant_post_instances2 (
   pis->payto_uris_length = payto_uris_length;
   pis->payto_uris = GNUNET_new_array (payto_uris_length,
                                       const char *);
-  memcpy (pis->payto_uris,
-          payto_uris,
-          sizeof (const char *) * payto_uris_length);
+  GNUNET_memcpy (pis->payto_uris,
+                 payto_uris,
+                 sizeof (const char *) * payto_uris_length);
   pis->name = name;
   pis->address = address; /* ownership transfer! */
   pis->jurisdiction = jurisdiction; /* ownership transfer! */
diff --git a/src/testing/testing_api_cmd_testserver.c 
b/src/testing/testing_api_cmd_testserver.c
index e80dcd78..f3a0cb4f 100644
--- a/src/testing/testing_api_cmd_testserver.c
+++ b/src/testing/testing_api_cmd_testserver.c
@@ -195,13 +195,13 @@ handler_cb (void *cls,
     void *body;
 
     body = GNUNET_malloc (rc->body_size + *upload_data_size);
-    memcpy (body,
-            rc->body,
-            rc->body_size);
+    GNUNET_memcpy (body,
+                   rc->body,
+                   rc->body_size);
     GNUNET_free (rc->body);
-    memcpy (body + rc->body_size,
-            upload_data,
-            *upload_data_size);
+    GNUNET_memcpy (body + rc->body_size,
+                   upload_data,
+                   *upload_data_size);
     rc->body = body;
     rc->body_size += *upload_data_size;
     *upload_data_size = 0;

-- 
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]