[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-183-g9fca468
by Werner Koch
cvs at cvs.gnupg.org
Mon Apr 13 17:19:09 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, master has been updated
via 9fca46864e1b5a9c788072113589454adb89fa97 (commit)
from 6e31a2805c5e808fe50a0c2529823f6501db2d38 (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 9fca46864e1b5a9c788072113589454adb89fa97
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 fbbd3b4..71b3f1c 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
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list