LIBGCRYPT-1-2-BRANCH libgcrypt/mpi (ChangeLog mpiutil.c)
cvs user mo
cvs at cvs.gnupg.org
Wed Feb 16 20:37:33 CET 2005
Date: Wednesday, February 16, 2005 @ 20:48:14
Author: mo
Path: /cvs/libgcrypt/libgcrypt/mpi
Tag: LIBGCRYPT-1-2-BRANCH
Modified: ChangeLog mpiutil.c
2005-02-16 Moritz Schulte <moritz at g10code.com>
* mpiutil.c (_gcry_mpi_alloc_limb_space): Rewritten, fixed memory
corruption.
-----------+
ChangeLog | 5 +++++
mpiutil.c | 15 ++++++---------
2 files changed, 11 insertions(+), 9 deletions(-)
Index: libgcrypt/mpi/ChangeLog
diff -u libgcrypt/mpi/ChangeLog:1.89.2.2 libgcrypt/mpi/ChangeLog:1.89.2.3
--- libgcrypt/mpi/ChangeLog:1.89.2.2 Wed Jan 5 14:52:33 2005
+++ libgcrypt/mpi/ChangeLog Wed Feb 16 20:48:13 2005
@@ -1,3 +1,8 @@
+2005-02-16 Moritz Schulte <moritz at g10code.com>
+
+ * mpiutil.c (_gcry_mpi_alloc_limb_space): Rewritten, fixed memory
+ corruption.
+
2005-01-05 Werner Koch <wk at g10code.com>
* hppa1.1/udiv-qrnnd.S: Reverted change of 2004-03-02 but kept the
Index: libgcrypt/mpi/mpiutil.c
diff -u libgcrypt/mpi/mpiutil.c:1.38 libgcrypt/mpi/mpiutil.c:1.38.2.1
--- libgcrypt/mpi/mpiutil.c:1.38 Wed Mar 3 09:08:43 2004
+++ libgcrypt/mpi/mpiutil.c Wed Feb 16 20:48:13 2005
@@ -75,16 +75,13 @@
mpi_ptr_t
_gcry_mpi_alloc_limb_space( unsigned int nlimbs, int secure )
{
- size_t len = nlimbs * sizeof(mpi_limb_t);
- mpi_ptr_t p = NULL;
+ mpi_ptr_t p;
+ size_t len;
- if (!nlimbs)
- {
- p = secure? gcry_xmalloc_secure( 1 ) : gcry_xmalloc( 1 );
- *p = 0;
- }
- else
- p = secure? gcry_xmalloc_secure( len ) : gcry_xmalloc( len );
+ len = (nlimbs ? nlimbs : 1) * sizeof (mpi_limb_t);
+ p = secure ? gcry_xmalloc_secure (len) : gcry_xmalloc (len);
+ if (! nlimbs)
+ *p = 0;
return p;
}
More information about the Gnupg-commits
mailing list