[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-367-g48ee918

by Werner Koch cvs at cvs.gnupg.org
Tue Mar 29 12:07:04 CEST 2016


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  48ee918400762281bec5b6fc218a9f0d119aac7c (commit)
      from  e2cbd22e03a68fbecc930052330df0c2096d2788 (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 48ee918400762281bec5b6fc218a9f0d119aac7c
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Mar 29 12:06:25 2016 +0200

    tests: Fix buffer overflow in bench-slope.
    
    * tests/bench-slope.c (bench_print_result_std): Remove wrong use of
    strncat.
    --
    
    Reported-by: Andreas Metzler <ametzler at bebt.de>
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tests/bench-slope.c b/tests/bench-slope.c
index 8938f18..d97494c 100644
--- a/tests/bench-slope.c
+++ b/tests/bench-slope.c
@@ -520,8 +520,6 @@ bench_print_result_std (double nsecs_per_byte)
   char mbpsec_buf[16];
   char cpbyte_buf[16];
 
-  strcpy (cpbyte_buf, "-");
-
   double_to_str (nsecpbyte_buf, sizeof (nsecpbyte_buf), nsecs_per_byte);
 
   /* If user didn't provide CPU speed, we cannot show cycles/byte results.  */
@@ -530,16 +528,15 @@ bench_print_result_std (double nsecs_per_byte)
       cycles_per_byte = nsecs_per_byte * cpu_ghz;
       double_to_str (cpbyte_buf, sizeof (cpbyte_buf), cycles_per_byte);
     }
+  else
+    strcpy (cpbyte_buf, "-");
 
   mbytes_per_sec =
     (1000.0 * 1000.0 * 1000.0) / (nsecs_per_byte * 1024 * 1024);
   double_to_str (mbpsec_buf, sizeof (mbpsec_buf), mbytes_per_sec);
 
-  strncat (nsecpbyte_buf, " ns/B", sizeof (nsecpbyte_buf) - 1);
-  strncat (mbpsec_buf, " MiB/s", sizeof (mbpsec_buf) - 1);
-  strncat (cpbyte_buf, " c/B", sizeof (cpbyte_buf) - 1);
-
-  printf ("%14s %15s %13s\n", nsecpbyte_buf, mbpsec_buf, cpbyte_buf);
+  printf ("%9s ns/B %9s MiB/s %9s c/B\n",
+          nsecpbyte_buf, mbpsec_buf, cpbyte_buf);
 }
 
 static void

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

Summary of changes:
 tests/bench-slope.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)


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