This is the mail archive of the binutils@sources.redhat.com 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]

Thumb32 assembler (26/69)


Bug-fix to hash_find_n.  Thanks to Alan Modra for pointing this out.

zw

	* hash.c (hash_lookup): Reverse order of operations in string
	comparison, to avoid reading past the end of the string.

===================================================================
Index: gas/hash.c
--- gas/hash.c	(revision 27)
+++ gas/hash.c	(revision 28)
@@ -168,7 +168,7 @@
 	  ++table->string_compares;
 #endif
 
-	  if (p->string[len] == '\0' && strncmp (p->string, key, len) == 0)
+	  if (strncmp (p->string, key, len) == 0 && p->string[len] == '\0')
 	    {
 	      if (prev != NULL)
 		{

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