[git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.21-6-g2c2121f

by Ineiev cvs at cvs.gnupg.org
Wed May 10 07:20:07 CEST 2017


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-1-4 has been updated
       via  2c2121ff3c2b90f21b75dd56c981b4d9e6d1c0e2 (commit)
      from  bb61191aad98c3dbb487c1f76dd1552d44a52fe3 (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 2c2121ff3c2b90f21b75dd56c981b4d9e6d1c0e2
Author: Ineiev <ineiev at gnu.org>
Date:   Thu Apr 14 15:42:25 2016 +0000

    g10: Fix secmem leak.
    
    * g10/keygen.c (proc_parameter_file): Fix secmem leak.
    
    --
    
    proc_parameter_file adds certain parameters to the list in the PARA
    argument; however, these new entries are leaked because they
    are added to head, while the PARA list is released by the caller
    of proc_parameter_file.
    
    GnuPG-bug-id: 1371
    Signed-off-by: Ineiev <ineiev at gnu.org>

diff --git a/g10/keygen.c b/g10/keygen.c
index 268fce5..dc6696a 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -2329,8 +2329,8 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
       r = xmalloc_clear(sizeof(*r));
       r->key = pKEYUSAGE;
       r->u.usage = openpgp_pk_algo_usage(algo);
-      r->next = para;
-      para = r;
+      r->next = para->next;
+      para->next = r;
     }
   else if (err == -1)
     return -1;
@@ -2363,8 +2363,8 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
 	  r = xmalloc_clear (sizeof(*r));
 	  r->key = pSUBKEYUSAGE;
 	  r->u.usage = openpgp_pk_algo_usage (algo);
-	  r->next = para;
-	  para = r;
+	  r->next = para->next;
+	  para->next = r;
 	}
       else if (err == -1)
 	return -1;
@@ -2400,8 +2400,8 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
 	    p = stpcpy(stpcpy(stpcpy(p," ("), s2 ),")");
 	  if( s3 )
 	    p = stpcpy(stpcpy(stpcpy(p," <"), s3 ),">");
-	  r->next = para;
-	  para = r;
+	  r->next = para->next;
+	  para->next = r;
 	  have_user_id=1;
 	}
     }
@@ -2460,13 +2460,13 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
     r = xmalloc_clear( sizeof *r );
     r->key = pPASSPHRASE_S2K;
     r->u.s2k = s2k;
-    r->next = para;
-    para = r;
+    r->next = para->next;
+    para->next = r;
     r = xmalloc_clear( sizeof *r );
     r->key = pPASSPHRASE_DEK;
     r->u.dek = dek;
-    r->next = para;
-    para = r;
+    r->next = para->next;
+    para->next = r;
   }
 
   /* Make KEYCREATIONDATE from Creation-Date.  */
@@ -2504,8 +2504,8 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
       r = xmalloc_clear( sizeof *r + 20 );
       r->key = pSUBKEYEXPIRE;
       r->u.expire = seconds;
-      r->next = para;
-      para = r;
+      r->next = para->next;
+      para->next = r;
     }
 
   if( !!outctrl->pub.newfname ^ !!outctrl->sec.newfname ) {

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

Summary of changes:
 g10/keygen.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)


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




More information about the Gnupg-commits mailing list