This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: readelf: Fix off by one error printing a gnu build note name


Hi Guys,

  I am checking in the patch below to fix an off by one error when
  printing the value associated with an ascii name in a GNU BUILD note.

Cheers
  Nick

binutils/ChangeLog
2017-03-17  Nick Clifton  <nickc@redhat.com>

	* readelf.c (print_gnu_build_attribute_name): Fix off by one error
	printing the value for a build note with an ascii name.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 5738fe5..ad65f07 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -16848,7 +16848,7 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
 	    len = left;
 	  printf ("%.*s ", len, name);
 	  left -= len;
-	  name += len + 1;
+	  name += len;
 	}
       else
 	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]