[git] GnuPG - branch, master, updated. gnupg-2.1.1-28-g657a26f

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Jan 8 04:35:26 CET 2015


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  657a26f3af1b3f817d6cde2d091273d332571247 (commit)
      from  100b322f5da3066bab5a2b0eb234c631c581c0e4 (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 657a26f3af1b3f817d6cde2d091273d332571247
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Jan 8 12:14:13 2015 +0900

    dirmngr: Fix error code path of map_host.
    
    * dirmngr/ks-engine-hkp.c (map_host): Fix error return.
    
    --
    
    In ks-engine-hkp.c on line 509 'reftbl' is freed, but it is then
    used on line 511. I'm guessing this is a missing return;.
    
    Reported-by: Joshua Rogers <honey at internot.info>
    
    Debian-Bug-Id: 773520
    
    Other fixes on error added too.

diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 3c6a003..ea607cb 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -325,6 +325,7 @@ static gpg_error_t
 map_host (ctrl_t ctrl, const char *name, int force_reselect,
           char **r_host, unsigned int *r_httpflags, char **r_poolname)
 {
+  gpg_error_t err = 0;
   hostinfo_t hi;
   int idx;
 
@@ -361,8 +362,9 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
       idx = create_new_hostinfo (name);
       if (idx == -1)
         {
+          err = gpg_error_from_syserror ();
           xfree (reftbl);
-          return gpg_error_from_syserror ();
+          return err;
         }
       hi = hosttable[idx];
 
@@ -504,9 +506,11 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
           hi->pool = xtryrealloc (reftbl, (refidx+1) * sizeof *reftbl);
           if (!hi->pool)
             {
+              err = gpg_error_from_syserror ();
               log_error ("shrinking index table in map_host failed: %s\n",
-                         strerror (errno));
+                         gpg_strerror (err));
               xfree (reftbl);
+              return err;
             }
           qsort (reftbl, refidx, sizeof *reftbl, sort_hostpool);
         }
@@ -570,12 +574,13 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
   *r_host = xtrystrdup (hi->name);
   if (!*r_host)
     {
+      err = gpg_error_from_syserror ();
       if (r_poolname)
         {
           xfree (*r_poolname);
           *r_poolname = NULL;
         }
-      return gpg_error_from_syserror ();
+      return err;
     }
   return 0;
 }

-----------------------------------------------------------------------

Summary of changes:
 dirmngr/ks-engine-hkp.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list