[git] GCRYPT - branch, master, updated. libgcrypt-1.7.3-91-ge0958de
by NIIBE Yutaka
cvs at cvs.gnupg.org
Fri Jun 2 03:38:20 CEST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
via e0958debe1a7db1bec1283115cdc6a14bf3b43e5 (commit)
from 5a22de904a0a366ae79f03ff1e13a1232a89e26b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e0958debe1a7db1bec1283115cdc6a14bf3b43e5
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Fri Jun 2 10:34:42 2017 +0900
secmem: Fix SEGV and stat calculation.
* src/secmem (init_pool): Care about the header size.
(_gcry_secmem_malloc_internal): Likewise.
(_gcry_secmem_malloc_internal): Use mb->size for stats.
--
GnuPG-bug-id: 3027
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/src/secmem.c b/src/secmem.c
index 8eb6630..86de72d 100644
--- a/src/secmem.c
+++ b/src/secmem.c
@@ -454,7 +454,7 @@ init_pool (pooldesc_t *pool, size_t n)
/* Initialize first memory block. */
mb = (memblock_t *) pool->mem;
- mb->size = pool->size;
+ mb->size = pool->size - BLOCK_HEAD_SIZE;
mb->flags = 0;
}
@@ -610,7 +610,7 @@ _gcry_secmem_malloc_internal (size_t size, int xhint)
mb = mb_get_new (pool, (memblock_t *) pool->mem, size);
if (mb)
{
- stats_update (pool, size, 0);
+ stats_update (pool, mb->size, 0);
return &mb->aligned.c;
}
@@ -624,7 +624,7 @@ _gcry_secmem_malloc_internal (size_t size, int xhint)
mb = mb_get_new (pool, (memblock_t *) pool->mem, size);
if (mb)
{
- stats_update (pool, size, 0);
+ stats_update (pool, mb->size, 0);
return &mb->aligned.c;
}
}
@@ -641,7 +641,7 @@ _gcry_secmem_malloc_internal (size_t size, int xhint)
return NULL; /* Not enough memory available for a new pool. */
/* Initialize first memory block. */
mb = (memblock_t *) pool->mem;
- mb->size = pool->size;
+ mb->size = pool->size - BLOCK_HEAD_SIZE;
mb->flags = 0;
pool->okay = 1;
@@ -660,7 +660,7 @@ _gcry_secmem_malloc_internal (size_t size, int xhint)
mb = mb_get_new (pool, (memblock_t *) pool->mem, size);
if (mb)
{
- stats_update (pool, size, 0);
+ stats_update (pool, mb->size, 0);
return &mb->aligned.c;
}
}
-----------------------------------------------------------------------
Summary of changes:
src/secmem.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list