readelf: mask unknown description data bytes.
authorJordan Rupprecht via binutils <binutils@sourceware.org>
Wed, 7 Aug 2019 20:48:14 +0000 (13:48 -0700)
committerAlan Modra <amodra@gmail.com>
Thu, 8 Aug 2019 01:43:29 +0000 (11:13 +0930)
When printing unknown note types, readelf prints the raw description
section byte-by-byte. However, it does not mask appropriately, e.g. it
prints the byte 'ba' as 'ffffffba'.

* readelf.c (process_note): Mask unknown description data bytes.

binutils/ChangeLog
binutils/readelf.c

index b60ae64b2729a3150095554dfdbad01b598bde06..0498a0c359552d2f65bb2336188ee998846fad3c 100644 (file)
@@ -1,3 +1,7 @@
+2019-08-08  Jordan Rupprecht  <rupprecht@google.com>
+
+       * readelf.c (process_note): Mask unknown description data bytes.
+
 2019-08-08  Alan Modra  <amodra@gmail.com>
 
        * readelf.c (get_data): Improve overflow checks.
index 3e3e27d19c5aaaa7525d7424b7549f681625d14d..3c8a9d418c04074c7ac92c1c9ffc90d968ab8175 100644 (file)
@@ -19115,7 +19115,7 @@ process_note (Elf_Internal_Note *  pnote,
 
       printf (_("   description data: "));
       for (i = 0; i < pnote->descsz; i++)
-       printf ("%02x ", pnote->descdata[i]);
+       printf ("%02x ", pnote->descdata[i] & 0xff);
       if (!do_wide)
        printf ("\n");
     }
This page took 0.029869 seconds and 4 git commands to generate.