[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] 02/05: avoid undefined behavior
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] 02/05: avoid undefined behavior |
Date: |
Wed, 04 Apr 2018 18:12:26 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository merchant.
commit 46b0b7e0baba6b4d2012bbd284a69a6892b66c0a
Author: Florian Dold <address@hidden>
AuthorDate: Wed Apr 4 17:28:57 2018 +0200
avoid undefined behavior
---
src/lib/merchant_api_pay.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c
index 75c2384..b0a2f0e 100644
--- a/src/lib/merchant_api_pay.c
+++ b/src/lib/merchant_api_pay.c
@@ -132,7 +132,9 @@ check_abort_refund (struct TALER_MERCHANT_Pay *ph,
}
num_refunds = json_array_size (refunds);
{
- struct TALER_MERCHANT_RefundEntry res[num_refunds];
+ /* The "+ 1" is necessary since num_refunds might be 0, and variable size
arrays must
+ * be >0, or it's undefined behavior */
+ struct TALER_MERCHANT_RefundEntry res[num_refunds + 1];
for (unsigned int i=0;i<num_refunds;i++)
{
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-merchant] branch master updated (ccfc69e -> e248e97), gnunet, 2018/04/04
- [GNUnet-SVN] [taler-merchant] 04/05: should be fixme, not preprocessor warning, gnunet, 2018/04/04
- [GNUnet-SVN] [taler-merchant] 05/05: change version number to 0.5, gnunet, 2018/04/04
- [GNUnet-SVN] [taler-merchant] 03/05: avoid undefined behavior again, return correct right status early, gnunet, 2018/04/04
- [GNUnet-SVN] [taler-merchant] 01/05: compute reserve expiration time properly, gnunet, 2018/04/04
- [GNUnet-SVN] [taler-merchant] 02/05: avoid undefined behavior,
gnunet <=