[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 01/03: memorypool: more sanity checks
From: |
gnunet |
Subject: |
[libmicrohttpd] 01/03: memorypool: more sanity checks |
Date: |
Wed, 07 Oct 2020 10:31:17 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 8a1ae1caf34c3d468dc96cd1c8681d93e265ff10
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Oct 6 19:23:39 2020 +0300
memorypool: more sanity checks
---
src/microhttpd/memorypool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c
index 4d619464..a979c64a 100644
--- a/src/microhttpd/memorypool.c
+++ b/src/microhttpd/memorypool.c
@@ -98,6 +98,7 @@ MHD_init_mem_pools_ (void)
#else
MHD_sys_page_size_ = MHD_DEF_PAGE_SIZE_;
#endif /* _WIN32 */
+ mhd_assert (0 == (MHD_sys_page_size_ % ALIGN_SIZE));
}
@@ -147,6 +148,7 @@ MHD_pool_create (size_t max)
struct MemoryPool *pool;
size_t alloc_size;
+ mhd_assert (max > 0);
pool = malloc (sizeof (struct MemoryPool));
if (NULL == pool)
return NULL;
@@ -195,6 +197,7 @@ MHD_pool_create (size_t max)
pool->is_mmap = true;
}
#endif /* _WIN32 || MAP_ANONYMOUS */
+ mhd_assert (0 == (((uintptr_t) pool->memory) % ALIGN_SIZE));
pool->pos = 0;
pool->end = alloc_size;
pool->size = alloc_size;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.