[git] GnuPG - branch, master, updated. gnupg-2.1.14-13-g1af2fd4
by Justus Winter
cvs at cvs.gnupg.org
Thu Jul 21 11:56:29 CEST 2016
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 Privacy Guard".
The branch, master has been updated
via 1af2fd44f0a66fd0d94c224319db0b128d42a288 (commit)
from 1598a4476466822e7e9c757ac471089d3db4b545 (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 1af2fd44f0a66fd0d94c224319db0b128d42a288
Author: Justus Winter <justus at g10code.com>
Date: Thu Jul 21 11:49:33 2016 +0200
g10: Fix crash.
* g10/tofu.c (tofu_closedbs): Fix freeing database handles up to the
cache limit. Previously, this would crash if db_cache_count == count.
Reported-by: Ben Kibbey <bjk at luxsci.net>
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/g10/tofu.c b/g10/tofu.c
index 471aec6..0b9d848 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -1104,8 +1104,14 @@ tofu_closedbs (ctrl_t ctrl)
is easy to skip the first COUNT entries since we still
have a handle on the old head. */
int skip = DB_CACHE_ENTRIES - count;
- while (-- skip > 0)
- old_head = old_head->next;
+ if (skip < 0)
+ for (old_head = db_cache, skip = DB_CACHE_ENTRIES;
+ skip > 0;
+ old_head = old_head->next, skip--)
+ { /* Do nothing. */ }
+ else
+ while (-- skip > 0)
+ old_head = old_head->next;
*old_head->prevp = NULL;
@@ -1116,6 +1122,8 @@ tofu_closedbs (ctrl_t ctrl)
old_head = db;
db_cache_count --;
}
+
+ log_assert (db_cache_count == DB_CACHE_ENTRIES);
}
}
-----------------------------------------------------------------------
Summary of changes:
g10/tofu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list