[git] GPGME - branch, master, updated. gpgme-1.11.1-104-g5ef492c
by Werner Koch
cvs at cvs.gnupg.org
Thu Jul 19 20:47:17 CEST 2018
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 "GnuPG Made Easy".
The branch, master has been updated
via 5ef492c5635ae1677eed6f439a75a86a99dbbe18 (commit)
from 085cdeddef637cc057362fcbde13b0261b8699ec (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 5ef492c5635ae1677eed6f439a75a86a99dbbe18
Author: Werner Koch <wk at gnupg.org>
Date: Thu Jul 19 20:38:21 2018 +0200
core: Clear all flags for a new data property.
* src/data.c (PROPERTY_TABLE_ALLOCATION_CHUNK): New.
(insert_into_property_table): Use it here. Clear all flags.
--
Fixes-commit: 085cdeddef637cc057362fcbde13b0261b8699ec
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/src/data.c b/src/data.c
index e826f10..1df6b0a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -63,6 +63,7 @@ typedef struct property_s *property_t;
static property_t property_table;
static unsigned int property_table_size;
DEFINE_STATIC_LOCK (property_table_lock);
+#define PROPERTY_TABLE_ALLOCATION_CHUNK 32
@@ -79,7 +80,7 @@ insert_into_property_table (gpgme_data_t dh, unsigned int *r_idx)
LOCK (property_table_lock);
if (!property_table)
{
- property_table_size = 10;
+ property_table_size = PROPERTY_TABLE_ALLOCATION_CHUNK;
property_table = calloc (property_table_size, sizeof *property_table);
if (!property_table)
{
@@ -98,7 +99,7 @@ insert_into_property_table (gpgme_data_t dh, unsigned int *r_idx)
property_t newtbl;
unsigned int newsize;
- newsize = property_table_size + 10;
+ newsize = property_table_size + PROPERTY_TABLE_ALLOCATION_CHUNK;;
if ((newsize * sizeof *property_table)
< (property_table_size * sizeof *property_table))
{
@@ -121,6 +122,7 @@ insert_into_property_table (gpgme_data_t dh, unsigned int *r_idx)
/* Slot found. */
property_table[idx].dh = dh;
property_table[idx].dserial = ++last_dserial;
+ memset (&property_table[idx].flags, 0, sizeof property_table[idx].flags);
*r_idx = idx;
err = 0;
-----------------------------------------------------------------------
Summary of changes:
src/data.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list