]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf.c: Assume the right size of an array
authorMarek Polacek <mpolacek@redhat.com>
Tue, 4 Oct 2011 09:11:42 +0000 (05:11 -0400)
committerUlrich Drepper <drepper@gmail.com>
Tue, 4 Oct 2011 09:11:42 +0000 (05:11 -0400)
src/ChangeLog
src/readelf.c

index 126c7ab7ece5d10fa613d8c82912c1ecfa6bc76c..2334693c960fb851f50accd038c8857c8a6dcfb7 100644 (file)
@@ -1,3 +1,7 @@
+2011-10-04  Marek Polacek  <mpolacek@redhat.com>
+
+       * readelf.c (register_info): Assume the right size of an array.
+
 2011-10-03  Ulrich Drepper  <drepper@gmail.com>
 
        * nm.c: Recognize option --mark-special.  Still recognize --mark-weak
index 4032bd432129904f3f04c05fb6b008a3948f1338..69b2abbe86aef86df567f27782eaf90d96f04e12 100644 (file)
@@ -4787,7 +4787,7 @@ register_info (Ebl *ebl, unsigned int regno, const Ebl_Register_Location *loc,
                                 bits ?: &ignore, type ?: &ignore);
   if (n <= 0)
     {
-      snprintf (name, sizeof name, "reg%u", loc->regno);
+      snprintf (name, REGNAMESZ, "reg%u", loc->regno);
       if (bits != NULL)
        *bits = loc->bits;
       if (type != NULL)