This is the mail archive of the binutils-cvs@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]

[binutils-gdb/users/hjl/linux/master] Fixes a bug in the previous delat to tekhex.c which meant that valid tekhex files were being rejecte


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c6e8e93a865d429546037cf5746502aa253a1f2d

commit c6e8e93a865d429546037cf5746502aa253a1f2d
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Jan 9 21:56:30 2015 +0000

    Fixes a bug in the previous delat to tekhex.c which meant that valid tekhex files were being rejected.
    
    	* tekhex.c (getvalue): Fix thinko in test for correct extraction
    	of value.
    	(getsym): Return false if there was not enough data to extract the
    	symbol.

Diff:
---
 bfd/ChangeLog | 7 +++++++
 bfd/tekhex.c  | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1bc66e4..70b138b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-09  Nick Clifton  <nickc@redhat.com>
+
+	* tekhex.c (getvalue): Fix thinko in test for correct extraction
+	of value.
+	(getsym): Return false if there was not enough data to extract the
+	symbol.
+
 2015-01-09  Anthony Green  <green@moxielogic.com>
 
 	* elf32-moxie.c (ELF_MACHINE_ALT1): Define.
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index 9444117..94b4773 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -288,7 +288,7 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
 
   *srcp = src;
   *valuep = value;
-  return len == 0;
+  return len == -1U;
 }
 
 static bfd_boolean
@@ -309,7 +309,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
   dstp[i] = 0;
   *srcp = src + i;
   *lenp = len;
-  return TRUE;
+  return i == len;
 }
 
 static struct data_struct *


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