[git] GnuPG - branch, master, updated. gnupg-2.1.13-86-g8f39185

by Justus Winter cvs at cvs.gnupg.org
Thu Jun 30 18:52:59 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  8f39185d7bfa0bc749f9ccf4a041d2da4eba24ff (commit)
       via  401db0eebbcd28dca8f4059706bfbd18d8cc7528 (commit)
       via  eb4cdbefb05795b77a8a72189eff246b84442caf (commit)
       via  1de362af9094e0a1a0be60f77fbea7c5190a4dcc (commit)
       via  6b9a89e4c7d6f19de62e0a908a8d80c98bf99819 (commit)
       via  d2d19063d3adf29340aeb39f14e1b1e9aacf41e7 (commit)
       via  9037c23979866e6e085b3e32f973bcba590a2635 (commit)
       via  29beea6462cca32d3278b0f7f9364ff4342327b8 (commit)
       via  5869f518cbd8b41b4c9880fc593216b9efeea430 (commit)
       via  84f262102be19334534cccc66ed7eceea2714527 (commit)
       via  abae8a9dc8a00cf46291ccb40644b3a7aa477307 (commit)
       via  5003caa8fdc80afd5748835c06621014f83e6ec4 (commit)
       via  599ad21104e622acbd1230d90d6a23abf9145499 (commit)
       via  d4ede89981c769b0626ab2b37615da1d12a3b078 (commit)
      from  dbcb342eaf1738798a5378d9ecd83c7946140d54 (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 8f39185d7bfa0bc749f9ccf4a041d2da4eba24ff
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 13:53:12 2016 +0200

    tools: Fix trivial memory leak.
    
    * tools/gpg-connect-agent.c (main): Fix trivial memory leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 1cd554f..6b5f507 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -1879,6 +1879,16 @@ main (int argc, char **argv)
   if (opt.verbose)
     log_info ("closing connection to agent\n");
 
+  /* XXX: We would like to release the context here, but libassuan
+     nicely says good bye to the server, which results in a SIGPIPE if
+     the server died.  Unfortunately, libassuan does not ignore
+     SIGPIPE when used with UNIX sockets, hence we simply leak the
+     context here.  */
+  if (0)
+    assuan_release (ctx);
+  else
+    gpgrt_annotate_leaked_object (ctx);
+  xfree (line);
   return 0;
 }
 

commit 401db0eebbcd28dca8f4059706bfbd18d8cc7528
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 18:49:15 2016 +0200

    g10: Fix memory leak.
    
    * g10/export.c (do_export_stream): Free secret parameters.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/export.c b/g10/export.c
index b067376..4137235 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -1557,6 +1557,15 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
 
               xfree (pk->seckey_info);
               pk->seckey_info = NULL;
+              {
+                int i;
+                for (i = pubkey_get_npkey (pk->pubkey_algo);
+                     i < pubkey_get_nskey (pk->pubkey_algo); i++)
+                  {
+                    gcry_mpi_release (pk->pkey[i]);
+                    pk->pkey[i] = NULL;
+                  }
+              }
               xfree (hexgrip);
             }
           else

commit eb4cdbefb05795b77a8a72189eff246b84442caf
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 18:45:02 2016 +0200

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

diff --git a/g10/keygen.c b/g10/keygen.c
index c561275..11eb587 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3481,6 +3481,7 @@ read_parameter_file (ctrl_t ctrl, const char *fname )
 	xfree( outctrl.pub.newfname );
     }
 
+    xfree (line);
     release_parameter_list( para );
     iobuf_close (fp);
     release_armor_context (outctrl.pub.afx);

commit 1de362af9094e0a1a0be60f77fbea7c5190a4dcc
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 17:55:06 2016 +0200

    g10: Fix memory leak.
    
    * g10/sign.c (mk_notation_policy_etc): Free 'mbox'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/sign.c b/g10/sign.c
index 5e46797..0f16e96 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -156,6 +156,7 @@ mk_notation_policy_etc (PKT_signature *sig,
           if (DBG_LOOKUP)
             log_debug ("setting Signer's UID to '%s'\n", mbox);
           build_sig_subpkt (sig, SIGSUBPKT_SIGNERS_UID, mbox, strlen (mbox));
+          xfree (mbox);
         }
     }
 }

commit 6b9a89e4c7d6f19de62e0a908a8d80c98bf99819
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 17:38:48 2016 +0200

    common: Fix memory leak.
    
    * g10/textfilter.c (copy_clearsig_text): Free buffer.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/textfilter.c b/g10/textfilter.c
index 5929c5f..6ca4f88 100644
--- a/g10/textfilter.c
+++ b/g10/textfilter.c
@@ -240,5 +240,6 @@ copy_clearsig_text( IOBUF out, IOBUF inp, gcry_md_hd_t md,
     if( truncated )
 	log_info(_("input line longer than %d characters\n"), MAX_LINELEN );
 
+    xfree (buffer);
     return 0; /* okay */
 }

commit d2d19063d3adf29340aeb39f14e1b1e9aacf41e7
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 17:29:19 2016 +0200

    common: Fix memory leak.
    
    * common/iobuf.c (iobuf_set_partial_body_length_mode): Only create
    context if necessary.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/common/iobuf.c b/common/iobuf.c
index c8ec00f..f3d67b4 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2530,9 +2530,6 @@ iobuf_get_fname_nonnull (iobuf_t a)
 void
 iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
 {
-  block_filter_ctx_t *ctx = xcalloc (1, sizeof *ctx);
-
-  ctx->use = a->use;
   if (!len)
     /* Disable partial body length mode.  */
     {
@@ -2546,6 +2543,8 @@ iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
   else
     /* Enabled partial body length mode.  */
     {
+      block_filter_ctx_t *ctx = xcalloc (1, sizeof *ctx);
+      ctx->use = a->use;
       ctx->partial = 1;
       ctx->size = 0;
       ctx->first_c = len;

commit 9037c23979866e6e085b3e32f973bcba590a2635
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 17:23:48 2016 +0200

    common: Fix memory leak.
    
    * common/simple-pwquery.c (agent_open): Free socket path.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c
index bdad140..708b157 100644
--- a/common/simple-pwquery.c
+++ b/common/simple-pwquery.c
@@ -340,6 +340,7 @@ agent_open (int *rfd)
   if ( !(p = strchr ( infostr, PATHSEP_C)) || p == infostr
        || (p-infostr)+1 >= sizeof client_addr.sun_path )
     {
+      spwq_free (infostr);
       return SPWQ_NO_AGENT;
     }
   *p++ = 0;
@@ -357,12 +358,14 @@ agent_open (int *rfd)
 #ifdef SPWQ_USE_LOGGING
       log_error ("can't create socket: %s\n", strerror(errno) );
 #endif
+      spwq_free (infostr);
       return SPWQ_SYS_ERROR;
     }
 
   memset (&client_addr, 0, sizeof client_addr);
   client_addr.sun_family = AF_UNIX;
   strcpy (client_addr.sun_path, infostr);
+  spwq_free (infostr);
   len = SUN_LEN (&client_addr);
 
 #ifdef HAVE_W32_SYSTEM
@@ -373,7 +376,8 @@ agent_open (int *rfd)
   if (rc == -1)
     {
 #ifdef SPWQ_USE_LOGGING
-      log_error ( _("can't connect to '%s': %s\n"), infostr, strerror (errno));
+      log_error (_("can't connect to '%s': %s\n"),
+                 client_addr.sun_path, strerror (errno));
 #endif
       close (fd );
       return SPWQ_IO_ERROR;

commit 29beea6462cca32d3278b0f7f9364ff4342327b8
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 17:09:59 2016 +0200

    g10: Fix keybox-related memory leaks.
    
    * g10/keydb.c (keydb_release): Clear keyblock cache.
    (keydb_get_keyblock): Revert previous change.
    * kbx/keybox-blob.c (create_blob_finish): Free previous buffer, free
    fixups after applying them.
    (_keybox_release_blob): Free buffer.  Currently, the buffer has been
    extracted before the keybox is released, but this is the right thing
    to do here.
    
    Fixes-commit: c57501cc
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/keydb.c b/g10/keydb.c
index c483bb1..e49e25f 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -937,6 +937,7 @@ keydb_release (KEYDB_HANDLE hd)
         }
     }
 
+  keyblock_cache_clear (hd);
   xfree (hd);
 }
 
@@ -1387,8 +1388,11 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
                 hd->keyblock_cache.pk_no     = pk_no;
                 hd->keyblock_cache.uid_no    = uid_no;
               }
-            xfree (sigstatus);
-            iobuf_close (iobuf);
+            else
+              {
+                xfree (sigstatus);
+                iobuf_close (iobuf);
+              }
           }
       }
       break;
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c
index 556605a..896f137 100644
--- a/kbx/keybox-blob.c
+++ b/kbx/keybox-blob.c
@@ -661,18 +661,24 @@ create_blob_finish (KEYBOXBLOB blob)
 
   /* do the fixups */
   if (blob->fixup_out_of_core)
-    return gpg_error (GPG_ERR_ENOMEM);
+    {
+      xfree (p);
+      return gpg_error (GPG_ERR_ENOMEM);
+    }
 
   {
-    struct fixup_list *fl;
-    for (fl = blob->fixups; fl; fl = fl->next)
+    struct fixup_list *fl, *next;
+    for (fl = blob->fixups; fl; fl = next)
       {
         assert (fl->off+4 <= n);
         p[fl->off+0] = fl->val >> 24;
         p[fl->off+1] = fl->val >> 16;
         p[fl->off+2] = fl->val >>  8;
         p[fl->off+3] = fl->val;
+        next = fl->next;
+        xfree (fl);
       }
+    blob->fixups = NULL;
   }
 
   /* Compute and store the SHA-1 checksum. */
@@ -680,8 +686,12 @@ create_blob_finish (KEYBOXBLOB blob)
 
   pp = xtrymalloc (n);
   if ( !pp )
-    return gpg_error_from_syserror ();
+    {
+      xfree (p);
+      return gpg_error_from_syserror ();
+    }
   memcpy (pp , p, n);
+  xfree (p);
   blob->blob = pp;
   blob->bloblen = n;
 
@@ -1000,7 +1010,11 @@ _keybox_release_blob (KEYBOXBLOB blob)
   int i;
   if (!blob)
     return;
-  /* hmmm: release membuf here?*/
+  if (blob->buf)
+    {
+      size_t len;
+      xfree (get_membuf (blob->buf, &len));
+    }
   xfree (blob->keys );
   xfree (blob->serialbuf);
   for (i=0; i < blob->nuids; i++)

commit 5869f518cbd8b41b4c9880fc593216b9efeea430
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 15:26:06 2016 +0200

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

diff --git a/g10/compress.c b/g10/compress.c
index bdddef1..c34beec 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -295,6 +295,10 @@ compress_filter( void *opaque, int control,
 static void
 release_context (compress_filter_context_t *ctx)
 {
+  xfree(ctx->inbuf);
+  ctx->inbuf = NULL;
+  xfree(ctx->outbuf);
+  ctx->outbuf = NULL;
   xfree (ctx);
 }
 

commit 84f262102be19334534cccc66ed7eceea2714527
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 14:00:46 2016 +0200

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

diff --git a/g10/sign.c b/g10/sign.c
index 3a96f0f..5e46797 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -627,6 +627,7 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
             log_error ("build_packet(PLAINTEXT) failed: %s\n",
                        gpg_strerror (rc) );
         pt->buf = NULL;
+        free_packet (&pkt);
     }
     else {
         byte copy_buffer[4096];

commit abae8a9dc8a00cf46291ccb40644b3a7aa477307
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 13:41:10 2016 +0200

    g10: Fix memory leak.
    
    * g10/mainproc.c (release_list): Do not exit early if list is NULL,
    there are other resources that must be released.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/mainproc.c b/g10/mainproc.c
index c191fe0..4217ccd 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -124,8 +124,6 @@ reset_literals_seen(void)
 static void
 release_list( CTX c )
 {
-  if (!c->list)
-    return;
   proc_tree (c, c->list);
   release_kbnode (c->list);
   while (c->pkenc_list)

commit 5003caa8fdc80afd5748835c06621014f83e6ec4
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 12:45:15 2016 +0200

    gpgscm: Fix reallocating string ports.
    
    * tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because
    Scheme strings may contain 0s.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 5f2f205..0a76205 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -1620,12 +1620,13 @@ static void backchar(scheme *sc, int c) {
 static int realloc_port_string(scheme *sc, port *p)
 {
   char *start=p->rep.string.start;
+  size_t old_size = p->rep.string.past_the_end - start;
   size_t new_size=p->rep.string.past_the_end-start+1+BLOCK_SIZE;
   char *str=sc->malloc(new_size);
   if(str) {
     memset(str,' ',new_size-1);
     str[new_size-1]='\0';
-    strcpy(str,start);
+    memcpy(str, start, old_size);
     p->rep.string.start=str;
     p->rep.string.past_the_end=str+new_size-1;
     p->rep.string.curr-=start-str;

commit 599ad21104e622acbd1230d90d6a23abf9145499
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 12:35:27 2016 +0200

    gpgscm: Free memory backing string ports.
    
    * tests/gpgscm/scheme.c (finalize_cell): Free memory backing string
    ports.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 4c28230..5f2f205 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -1390,6 +1390,8 @@ static void finalize_cell(scheme *sc, pointer a) {
     if(a->_object._port->kind&port_file
        && a->_object._port->rep.stdio.closeit) {
       port_close(sc,a,port_input|port_output);
+    } else if (a->_object._port->kind & port_srfi6) {
+      sc->free(a->_object._port->rep.string.start);
     }
     sc->free(a->_object._port);
   } else if(is_foreign_object(a)) {

commit d4ede89981c769b0626ab2b37615da1d12a3b078
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 11:46:38 2016 +0200

    gpgscm: Use the allocator from libgcrypt.
    
    * tests/gpgscm/main.c (main): Use the allocator from libgcrypt.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/main.c b/tests/gpgscm/main.c
index adb4e33..5b3792e 100644
--- a/tests/gpgscm/main.c
+++ b/tests/gpgscm/main.c
@@ -39,6 +39,7 @@
 #include "../../common/logging.h"
 #include "../../common/strlist.h"
 #include "../../common/sysutils.h"
+#include "../../common/util.h"
 
 /* The TinyScheme banner.  Unfortunately, it isn't in the header
    file.  */
@@ -236,7 +237,7 @@ main (int argc, char **argv)
   if (log_get_errorcount (0))
     exit (2);
 
-  sc = scheme_init_new ();
+  sc = scheme_init_new_custom_alloc (gcry_malloc, gcry_free);
   if (! sc) {
     fprintf (stderr, "Could not initialize TinyScheme!\n");
     return 2;

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

Summary of changes:
 common/iobuf.c            |  5 ++---
 common/simple-pwquery.c   |  6 +++++-
 g10/compress.c            |  4 ++++
 g10/export.c              |  9 +++++++++
 g10/keydb.c               |  8 ++++++--
 g10/keygen.c              |  1 +
 g10/mainproc.c            |  2 --
 g10/sign.c                |  2 ++
 g10/textfilter.c          |  1 +
 kbx/keybox-blob.c         | 24 +++++++++++++++++++-----
 tests/gpgscm/main.c       |  3 ++-
 tests/gpgscm/scheme.c     |  5 ++++-
 tools/gpg-connect-agent.c | 10 ++++++++++
 13 files changed, 65 insertions(+), 15 deletions(-)


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




More information about the Gnupg-commits mailing list