[git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-2-g9ba6814

by Werner Koch cvs at cvs.gnupg.org
Thu May 21 17:21:49 CEST 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 crypto library".

The branch, LIBGCRYPT-1-6-BRANCH has been updated
       via  9ba681427ef5450250ae1d3e6aa0e342dc7949f6 (commit)
      from  64ddbac59372a6e54aa004d8df0bb3ce53574803 (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 9ba681427ef5450250ae1d3e6aa0e342dc7949f6
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Apr 13 11:48:33 2015 +0200

    mpi: Fix gcry_mpi_copy for NULL opaque data.
    
    * mpi/mpiutil.c (_gcry_mpi_copy): Copy opaque only if needed.
    --
    
    gcry_mpi_set_opaque allows to store NULL as opaque data.  Thus we also
    need to take care when copying such data.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c
index 6bef2a8..59b8f93 100644
--- a/mpi/mpiutil.c
+++ b/mpi/mpiutil.c
@@ -343,7 +343,8 @@ _gcry_mpi_copy (gcry_mpi_t a)
     if( a && (a->flags & 4) ) {
 	void *p = _gcry_is_secure(a->d)? xmalloc_secure ((a->sign+7)/8)
                                        : xmalloc ((a->sign+7)/8);
-	memcpy( p, a->d, (a->sign+7)/8 );
+        if (a->d)
+          memcpy( p, a->d, (a->sign+7)/8 );
 	b = mpi_set_opaque( NULL, p, a->sign );
         b->flags &= ~(16|32); /* Reset the immutable and constant flags.  */
     }

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

Summary of changes:
 mpi/mpiutil.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org




More information about the Gnupg-commits mailing list