aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/coffgen.c5
-rw-r--r--bfd/peicode.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index f21cf2c..774edf7 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -443,10 +443,7 @@ _bfd_coff_internal_syment_name (bfd *abfd,
if (strings == NULL)
return NULL;
}
- /* 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))
+ if (sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
return NULL;
return strings + sym->_n._n_n._n_offset;
}
diff --git a/bfd/peicode.h b/bfd/peicode.h
index b7b4f4a..f1f3ce8 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1147,6 +1147,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
obj_conv_table_size (abfd) = vars.sym_index;
obj_coff_strings (abfd) = vars.string_table;
+ obj_coff_strings_len (abfd) = vars.string_ptr - vars.string_table;
obj_coff_keep_strings (abfd) = true;
return true;