[git] GnuPG - branch, master, updated. gnupg-2.1.13-94-g49fdd08

by Justus Winter cvs at cvs.gnupg.org
Fri Jul 1 14:17:04 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  49fdd0887c84ed7f7b858b9e7ffa146fcb7f1e87 (commit)
       via  78aeb236fe4ff3a6d51b3095148e7086f2a6e9a8 (commit)
       via  cff63da930b6b3f0253668911e0931713b2b584a (commit)
       via  c454922ffa71929c810c6ff048d902498575302f (commit)
       via  ff77b92aae9c8e20cbc7fa7c294adcc6a8c2f614 (commit)
       via  44d4c695722d96b3bbef16f2843f62413b9670cd (commit)
       via  5fafd18d474da7b763f5b82c73b6ca4288e136d7 (commit)
      from  6bfbc368f90b274192d3751274816091675f5109 (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 49fdd0887c84ed7f7b858b9e7ffa146fcb7f1e87
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 14:09:58 2016 +0200

    common: Annotate semi-static allocation.
    
    * common/argparse.c (optfile_parse): Allow string arguments to leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/common/argparse.c b/common/argparse.c
index 00cde23..240fdce 100644
--- a/common/argparse.c
+++ b/common/argparse.c
@@ -699,6 +699,8 @@ optfile_parse (FILE *fp, const char *filename, unsigned *lineno,
                         }
                       if (!set_opt_arg (arg, opts[idx].flags, p))
                         xfree (buffer);
+                      else
+                        gpgrt_annotate_leaked_object (buffer);
                     }
                 }
               break;

commit 78aeb236fe4ff3a6d51b3095148e7086f2a6e9a8
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 14:09:01 2016 +0200

    g10: Fix memory leak.
    
    * g10/keyserver.c (parse_keyserver_uri): Free URI.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/keyserver.c b/g10/keyserver.c
index d7105de..2e2d6a4 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -240,13 +240,13 @@ parse_keyserver_uri (const char *string,int require_scheme)
   struct keyserver_spec *keyserver;
   const char *idx;
   int count;
-  char *uri,*options;
+  char *uri, *duped_uri, *options;
 
   log_assert (string);
 
   keyserver=xmalloc_clear(sizeof(struct keyserver_spec));
 
-  uri=xstrdup(string);
+  duped_uri = uri = xstrdup (string);
 
   options=strchr(uri,' ');
   if(options)
@@ -434,11 +434,13 @@ parse_keyserver_uri (const char *string,int require_scheme)
       goto fail;
     }
 
+  xfree (duped_uri);
   return keyserver;
 
  fail:
   free_keyserver_spec(keyserver);
 
+  xfree (duped_uri);
   return NULL;
 }
 

commit cff63da930b6b3f0253668911e0931713b2b584a
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 13:44:32 2016 +0200

    tools/gpgtar: Annotate semi-static allocation.
    
    * tools/gpgtar.c (shell_parse_argv): Annotate argument vector as
    leaked.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index 416f514..a3429de 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -275,7 +275,12 @@ shell_parse_argv (const char *s, int *r_argc, char ***r_argv)
     return 1;
 
   for (i = 0; list; i++)
-    (*r_argv)[i] = list->d, list = list->next;
+    {
+      gpgrt_annotate_leaked_object (list);
+      (*r_argv)[i] = list->d;
+      list = list->next;
+    }
+  gpgrt_annotate_leaked_object (*r_argv);
   return 0;
 }
 


commit c454922ffa71929c810c6ff048d902498575302f
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 13:43:01 2016 +0200

    g10: Fix memory leak.
    
    * g10/import.c (transfer_secret_keys): Release curve from the previous
    iteration.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/import.c b/g10/import.c
index b6bc0f2..332e266 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1524,6 +1524,7 @@ transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats,
           else
             {
               const char *curvename = openpgp_oid_to_curve (curvestr, 1);
+              gcry_sexp_release (curve);
               err = gcry_sexp_build (&curve, NULL, "(curve %s)",
                                      curvename?curvename:curvestr);
               xfree (curvestr);

commit ff77b92aae9c8e20cbc7fa7c294adcc6a8c2f614
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 12:50:29 2016 +0200

    g10: Fix build with disabled kbnode cache.
    
    * g10/kbnode.c (release_unused_nodes): Fix build with disabled kbnode
    cache.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/kbnode.c b/g10/kbnode.c
index a1d1f3d..e814fa8 100644
--- a/g10/kbnode.c
+++ b/g10/kbnode.c
@@ -34,18 +34,18 @@
 static int cleanup_registered;
 static KBNODE unused_nodes;
 
-#if USE_UNUSED_NODES
 static void
 release_unused_nodes (void)
 {
+#if USE_UNUSED_NODES
   while (unused_nodes)
     {
       kbnode_t next = unused_nodes->next;
       xfree (unused_nodes);
       unused_nodes = next;
     }
-}
 #endif /*USE_UNUSED_NODES*/
+}
 
 
 static kbnode_t

commit 44d4c695722d96b3bbef16f2843f62413b9670cd
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 12:48:57 2016 +0200

    g10: Fix memory leak.
    
    * g10/trustdb.c (tdb_get_validity_core): Fix kbnode leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/trustdb.c b/g10/trustdb.c
index 527a23d..dd74d18 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1022,17 +1022,18 @@ tdb_get_validity_core (ctrl_t ctrl,
 #ifdef USE_TOFU
   if (opt.trust_model == TM_TOFU || opt.trust_model == TM_TOFU_PGP)
     {
-      kbnode_t user_id_node = NULL; /* Silence -Wmaybe-uninitialized.  */
+      kbnode_t user_id_node = NULL;
+      kbnode_t n = NULL;	/* Silence -Wmaybe-uninitialized.  */
       int user_ids = 0;
       int user_ids_expired = 0;
 
       /* If the caller didn't supply a user id then iterate over all
 	 uids.  */
       if (! uid)
-	user_id_node = get_pubkeyblock (main_pk->keyid);
+	user_id_node = n = get_pubkeyblock (main_pk->keyid);
 
       while (uid
-	     || (user_id_node = find_next_kbnode (user_id_node, PKT_USER_ID)))
+	     || (n = find_next_kbnode (n, PKT_USER_ID)))
 	{
 	  unsigned int tl;
 	  PKT_user_id *user_id;
@@ -1040,7 +1041,7 @@ tdb_get_validity_core (ctrl_t ctrl,
 	  if (uid)
 	    user_id = uid;
 	  else
-	    user_id = user_id_node->pkt->pkt.user_id;
+	    user_id = n->pkt->pkt.user_id;
 
           /* If the user id is revoked or expired, then skip it.  */
 	  if (user_id->is_revoked || user_id->is_expired)
@@ -1094,6 +1095,7 @@ tdb_get_validity_core (ctrl_t ctrl,
 	       now.  */
 	    break;
 	}
+      release_kbnode (user_id_node);
     }
 #endif /*USE_TOFU*/
 

commit 5fafd18d474da7b763f5b82c73b6ca4288e136d7
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 11:26:54 2016 +0200

    g10: Fix memory leak.
    
    * g10/keygen.c (keygen_set_std_prefs): Fix memory leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/keygen.c b/g10/keygen.c
index 11eb587..3a9a8e7 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -413,9 +413,9 @@ keygen_set_std_prefs (const char *string,int personal)
 
     if(strlen(string))
       {
-	char *tok,*prefstring;
+	char *dup, *tok, *prefstring;
 
-	prefstring=xstrdup(string); /* need a writable string! */
+	dup = prefstring = xstrdup (string); /* need a writable string! */
 
 	while((tok=strsep(&prefstring," ,")))
 	  {
@@ -449,7 +449,7 @@ keygen_set_std_prefs (const char *string,int personal)
 	      }
 	  }
 
-	xfree(prefstring);
+	xfree (dup);
       }
 
     if(!rc)

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

Summary of changes:
 common/argparse.c |  2 ++
 g10/import.c      |  1 +
 g10/kbnode.c      |  4 ++--
 g10/keygen.c      |  6 +++---
 g10/keyserver.c   |  6 ++++--
 g10/trustdb.c     | 10 ++++++----
 tools/gpgtar.c    |  7 ++++++-
 7 files changed, 24 insertions(+), 12 deletions(-)


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




More information about the Gnupg-commits mailing list