[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-14-g377ff84

by Jim Meyering cvs at cvs.gnupg.org
Fri Nov 11 16:54:12 CET 2011


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  377ff84d2187e02e723068d2b14a25cdbc7f5755 (commit)
      from  ba7127721035ee0937167e16465cc9f40b39257d (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 377ff84d2187e02e723068d2b14a25cdbc7f5755
Author: Jim Meyering <jim at meyering.net>
Date:   Fri Nov 11 11:38:19 2011 +0100

    tests: avoid write-beyond-end-of-heap buffer
    
    In libgcrypt's "make check" (latest from git), I was surprised to
    see the "basic" test fail.  Here's a patch:
    
    Avoid scary-looking (with MALLOC_CHECK_=3) "make check" test failure:
    
      *** glibc detected *** /h/j/w/co/libgcrypt/tests/.libs/lt-basic: free(): invalid
      pointer: 0x0000000001f9d080 ***
      ======= Backtrace: =========
      /lib64/libc.so.6[0x3a5807c606]
      /w/libgcrypt/src/.libs/libgcrypt.so.19(+0x100c9)[0x7f890edb90c9]
      /w/libgcrypt/src/.libs/libgcrypt.so.19(+0xb03e)[0x7f890edb403e]
      /w/libgcrypt/src/.libs/libgcrypt.so.19(gcry_free+0x18)[0x7f890edb1eef]
      /w/libgcrypt/tests/.libs/lt-basic[0x4091f4]
      /w/libgcrypt/tests/.libs/lt-basic[0x40b541]
      /lib64/libc.so.6(__libc_start_main+0xed)[0x3a5802169d]
      /w/libgcrypt/tests/.libs/lt-basic[0x401979]
      ======= Memory map: ========
      00400000-00411000 r-xp 00000000 08:08 2787510 /w/co/libgcrypt/tests/.libs/lt-basic
      ...
    
    >From 722e6d470371bb3d995e0a6a67cd9c2ffd7bb664 Mon Sep 17 00:00:00 2001
    From: Jim Meyering <meyering at redhat.com>
    Date: Fri, 11 Nov 2011 11:34:45 +0100
    Subject: [PATCH] tests: avoid write-beyond-end-of-heap buffer
    
    * basic.c (check_bulk_cipher_modes): Allocate one more byte in
    each of the two test buffers.  Otherwise, running
    "env -i MALLOC_CHECK_=3 ./basic" would abort.

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 8e96898..573b331 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-11  Jim Meyering  <meyering at redhat.com>
+
+	tests: avoid write-beyond-end-of-heap buffer
+	* basic.c (check_bulk_cipher_modes): Allocate one more byte in
+	each of the two test buffers.  Otherwise, running
+	"env -i MALLOC_CHECK_=3 ./basic" would abort.
+
 2011-09-15  Werner Koch  <wk at g10code.com>
 
 	* register.c: Remove.
diff --git a/tests/basic.c b/tests/basic.c
index cdc3462..9b2d0a8 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -1251,9 +1251,9 @@ check_bulk_cipher_modes (void)
     fprintf (stderr, "Starting bulk cipher checks.\n");
 
   buflen = 16*100;  /* We check a 1600 byte buffer.  */
-  buffer_base = gcry_xmalloc (buflen+15);
+  buffer_base = gcry_xmalloc (buflen+16);
   buffer = buffer_base + (16 - ((size_t)buffer_base & 0x0f));
-  outbuf_base = gcry_xmalloc (buflen+15);
+  outbuf_base = gcry_xmalloc (buflen+16);
   outbuf = outbuf_base + (16 - ((size_t)outbuf_base & 0x0f));
 
 

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

Summary of changes:
 tests/ChangeLog |    7 +++++++
 tests/basic.c   |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list