gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: fix possible NULL d


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: fix possible NULL deref, simplify logic
Date: Tue, 09 May 2017 13:19:41 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 7836422  fix possible NULL deref, simplify logic
7836422 is described below

commit 783642272d83fae148edfd308c86b157c3e4a6d4
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue May 9 13:24:53 2017 +0200

    fix possible NULL deref, simplify logic
---
 src/bank-lib/fakebank.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index f8edd08..0359b4a 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -476,20 +476,15 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
   }
   else
   {
-    if (NULL == h->transactions_head)
-    {
-      GNUNET_break (0);
-      return MHD_NO;
-    }
     for (pos = h->transactions_head;
-         pos->serial_id != start_number;
+         NULL != pos;
          pos = pos->next)
+      if (pos->serial_id == start_number)
+        break;
+    if (NULL == pos)
     {
-      if (NULL == pos)
-      {
-        GNUNET_break (0);
-        return MHD_NO;
-      }
+      GNUNET_break (0);
+      return MHD_NO;
     }
     /* range is exclusive, skip the matching entry */
     if (count > 0)

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



reply via email to

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