gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 01/02: proper overflow check


From: gnunet
Subject: [gnunet] 01/02: proper overflow check
Date: Sun, 25 Jun 2023 16:42:07 +0200

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

oec pushed a commit to branch master
in repository gnunet.

commit 4b3ff0e1e18c2bba72e36dcc97c50cf50fcdb9a1
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Sun Jun 25 16:41:00 2023 +0200

    proper overflow check
---
 src/pq/pq_query_helper.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 932f3cb0b..2293c8005 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -689,7 +689,7 @@ qconv_array (
     /* num * length-field */
     size_t x = sizeof(uint32_t);
     size_t y = x * num;
-    RETURN_UNLESS (y >= num);
+    RETURN_UNLESS ((0 == num) || (y / num == x));
 
     /* size of header */
     total_size  = x = sizeof(struct pq_array_header);
@@ -700,11 +700,11 @@ qconv_array (
     if (same_sized)
     {
       x = num * meta->same_size;
-      RETURN_UNLESS (x >= num);
+      RETURN_UNLESS ((0 == num) || (x / num == meta->same_size));
 
       y = total_size;
       total_size += x;
-      RETURN_UNLESS ((total_size >= y));
+      RETURN_UNLESS (total_size >= y);
     }
     else  /* sizes are different per element */
     {

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