This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fixes a problem recognizing libraries created by Visual Studio.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 27 Feb 2015 15:40:59 -0000
- Subject: [binutils-gdb] Fixes a problem recognizing libraries created by Visual Studio.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cdb602b17548eeebb5e700c507d734ea5f887a49
commit cdb602b17548eeebb5e700c507d734ea5f887a49
Author: Nick Clifton <nickc@redhat.com>
Date: Fri Feb 27 15:38:32 2015 +0000
Fixes a problem recognizing libraries created by Visual Studio.
PR binutils/17910
* coffgen.c (_bfd_coff_internal_syment_name): Only check for
string length overflow when the string table length is actually
set.
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/coffgen.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dea16ae..1b223f9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-27 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17910
+ * coffgen.c (_bfd_coff_internal_syment_name): Only check for
+ string length overflow when the string table length is actually
+ set.
+
2015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
* bfd/bfd-in2.h: Regenerate.
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index aa01559..83673d4 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -468,7 +468,10 @@ _bfd_coff_internal_syment_name (bfd *abfd,
if (strings == NULL)
return NULL;
}
- if (sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
+ /* PR 17910: Only check for string overflow if the length has been set.
+ Some DLLs, eg those produced by Visual Studio, may not set the length field. */
+ if (obj_coff_strings_len (abfd) > 0
+ && sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
return NULL;
return strings + sym->_n._n_n._n_offset;
}