This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Thumb32 assembler (26/69)
- From: Zack Weinberg <zack at codesourcery dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Tue, 26 Apr 2005 02:54:38 -0700
- Subject: 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)
{