In `register_info' we're taking the size of argument `name', which is wrong,
since we get just the size of a pointer, not size of the array.  This patch
fixes it.  Tested on x86_64 using trunk gcc.

I have trouble with git+ssh (Permission denied (publickey), although I have
my right pub key on fedorahosted.com), so I'd not be able to push this in case
it's fine.  Thanks.

2011-10-04  Marek Polacek  <[email protected]>

        * readelf.c (register_info): Assume the right size of an array.

--- elfutils/src/readelf.c.mp   2011-08-30 10:51:27.869835636 +0200
+++ elfutils/src/readelf.c      2011-08-30 10:51:42.329960296 +0200
@@ -4787,7 +4787,7 @@ register_info (Ebl *ebl, unsigned int re
                                 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)

        Marek  
_______________________________________________
elfutils-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to