gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 02/10: memorypool: added assert in MHD_pool_reallocate()


From: gnunet
Subject: [libmicrohttpd] 02/10: memorypool: added assert in MHD_pool_reallocate()
Date: Wed, 29 Sep 2021 19:52:44 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 7278e5818e0b96b9a0b2808ab2e8bd79730396fe
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 29 15:16:46 2021 +0300

    memorypool: added assert in MHD_pool_reallocate()
---
 src/microhttpd/memorypool.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index 63181f59..c5e5b4fd 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -350,6 +350,9 @@ MHD_pool_reallocate (struct MemoryPool *pool,
   /* (old == NULL || old_size == 0 || pool->memory + pool->pos > (uint8_t*) 
old) */
   mhd_assert (old == NULL || old_size == 0 || \
               pool->pos > (size_t) ((uint8_t*) old - pool->memory));
+  mhd_assert (old == NULL || old_size == 0 || \
+              (size_t) (((uint8_t*) old) - pool->memory) + old_size <= \
+              pool->end);
 
   if (0 != old_size)
   {   /* Need to save some data */

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