[Pkg-gnupg-commit] [gnupg2] 208/241: gpg: Fix type mismatch resulting in a buffer overflow.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Dec 9 20:32:18 UTC 2015


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

dkg pushed a commit to branch master
in repository gnupg2.

commit c73d75103cbd34975e2bd28e9924caee05eaf829
Author: Neal H. Walfield <neal at g10code.com>
Date:   Wed Dec 2 15:20:18 2015 +0100

    gpg: Fix type mismatch resulting in a buffer overflow.
    
    * g10/tofu.c (record_binding): Change policy_old's type from an enum
    tofu_policy to a long: this variable is passed by reference and a long
    is expected.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    Reported-by: Justus Winter <justus at g10code.com>
    Fixes-commit: f77913e
---
 g10/tofu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/g10/tofu.c b/g10/tofu.c
index d340bfe..2433b7b 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -1079,7 +1079,10 @@ record_binding (struct dbs *dbs, const char *fingerprint, const char *email,
   struct db *db_email = NULL, *db_key = NULL;
   int rc;
   char *err = NULL;
-  enum tofu_policy policy_old = TOFU_POLICY_NONE;
+  /* policy_old needs to be a long and not an enum tofu_policy,
+     because we pass it by reference to get_single_long_cb2, which
+     expects a long.  */
+  long policy_old = TOFU_POLICY_NONE;
 
   if (! (policy == TOFU_POLICY_AUTO
 	 || policy == TOFU_POLICY_GOOD

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list