]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix a couple of buffer overruns. n-i-bz.
authorJulian Seward <jseward@acm.org>
Fri, 30 Sep 2011 07:11:13 +0000 (07:11 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 30 Sep 2011 07:11:13 +0000 (07:11 +0000)
(Philippe Waroquiers, philippe.waroquiers@skynet.be)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12074

coregrind/m_translate.c
lackey/lk_main.c

index 894c8d41390c6b4aac80048c8691c732f6bf06be..1f1cb6642c356247e9ce8e3573806966eb5ec505 100644 (file)
@@ -71,7 +71,7 @@ static UInt n_SP_updates_generic_unknown = 0;
 
 void VG_(print_translation_stats) ( void )
 {
-   Char buf[6];
+   Char buf[7];
    UInt n_SP_updates = n_SP_updates_fast + n_SP_updates_generic_known
                                          + n_SP_updates_generic_unknown;
    VG_(percentify)(n_SP_updates_fast, n_SP_updates, 1, 6, buf);
index 1b2659c953065548fed0e0a3f6a434a9d50a6d1e..9e908b734af506ee1d5ead6171c6969403296fdd 100644 (file)
@@ -908,8 +908,8 @@ IRSB* lk_instrument ( VgCallbackClosure* closure,
 
 static void lk_fini(Int exitcode)
 {
-   char percentify_buf[4]; /* Two digits, '%' and 0. */
-   const int percentify_size = sizeof(percentify_buf);
+   char percentify_buf[5]; /* Two digits, '%' and 0. */
+   const int percentify_size = sizeof(percentify_buf) - 1;
    const int percentify_decs = 0;
    
    tl_assert(clo_fnname);