[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.10-18-g26ebb15

by Werner Koch cvs at cvs.gnupg.org
Thu Oct 25 17:38:06 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 "The GNU Privacy Guard".

The branch, STABLE-BRANCH-2-2 has been updated
       via  26ebb15bec897a105b248680c1ddf1806592b1eb (commit)
      from  e53253485cd7ceb7012505a629d2cd997167ccab (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 26ebb15bec897a105b248680c1ddf1806592b1eb
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 25 17:21:52 2018 +0200

    dirmngr: Fix out of scope use of a var in the keyserver LDAP code.
    
    * dirmngr/ks-engine-ldap.c (extract_attributes): Don't use a variabale
    out of scope and cleanup the entire pgpKeySize block.
    --
    
    GnuPG-bug-id: 4229
    Signed-off-by: Werner Koch <wk at gnupg.org>
    (cherry picked from commit 2b57a8159cdc3b212a4efc68787b40cafcd91ebe)

diff --git a/dirmngr/ks-engine-ldap.c b/dirmngr/ks-engine-ldap.c
index f50ba50..d94bd5e 100644
--- a/dirmngr/ks-engine-ldap.c
+++ b/dirmngr/ks-engine-ldap.c
@@ -1694,26 +1694,16 @@ extract_attributes (LDAPMod ***modlist, char *line)
 
   if (is_pub || is_sub)
     {
-      char *size = fields[2];
-      int val = atoi (size);
-      size = NULL;
+      char padded[6];
+      int val;
 
-      if (val > 0)
-	{
-	  /* We zero pad this on the left to make PGP happy. */
-	  char padded[6];
-	  if (val < 99999 && val > 0)
-	    {
-	      snprintf (padded, sizeof padded, "%05u", val);
-	      size = padded;
-	    }
-	}
-
-      if (size)
-	{
-	  if (is_pub || is_sub)
-	    modlist_add (modlist, "pgpKeySize", size);
-	}
+      val = atoi (fields[2]);
+      if (val < 99999 && val > 0)
+        {
+          /* We zero pad this on the left to make PGP happy. */
+          snprintf (padded, sizeof padded, "%05u", val);
+          modlist_add (modlist, "pgpKeySize", padded);
+        }
     }
 
   if (is_pub)
@@ -1736,10 +1726,7 @@ extract_attributes (LDAPMod ***modlist, char *line)
 	}
 
       if (algo)
-	{
-	  if (is_pub)
-	    modlist_add (modlist, "pgpKeyType", algo);
-	}
+        modlist_add (modlist, "pgpKeyType", algo);
     }
 
   if (is_pub || is_sub || is_sig)

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

Summary of changes:
 dirmngr/ks-engine-ldap.c | 33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)


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




More information about the Gnupg-commits mailing list