diff options
author | Alan Modra <amodra@gmail.com> | 2024-10-16 08:30:07 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-10-16 16:02:05 +1030 |
commit | 02d1e73bf63bb6d4e7c8b1eb35964cd2e00228d5 (patch) | |
tree | 67f1dc324912f0b4f718982bce3cce2e52d90e18 | |
parent | bc85bc665a95b84aba854653b4289a3b1c4fbf05 (diff) | |
download | binutils-02d1e73bf63bb6d4e7c8b1eb35964cd2e00228d5.zip binutils-02d1e73bf63bb6d4e7c8b1eb35964cd2e00228d5.tar.gz binutils-02d1e73bf63bb6d4e7c8b1eb35964cd2e00228d5.tar.bz2 |
Assertion fail at peicode.h:607
This is the assertion that vars->string_ptr < vars->end_string_ptr,
ie. when it fails we've overflowed the string buffer area. Caused by
allocating space for import_name but writing symbol_name, and they can
be different.
* peicode.h (SIZEOF_ILF_STRINGS): Revert 042f14505e change.
-rw-r--r-- | bfd/peicode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index eb5d6da..1a084fd 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -410,7 +410,7 @@ pe_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd) There will be two symbols for the imported value, one the symbol name and one with _imp__ prefixed. Allowing for the terminating nul's this - is strlen (import_name) * 2 + 8 + 21 + strlen (source_dll). + is strlen (symbol_name) * 2 + 8 + 21 + strlen (source_dll). The strings in the string table must start STRING__SIZE_SIZE bytes into the table in order to for the string lookup code in coffgen/coffcode to @@ -426,7 +426,7 @@ pe_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd) #define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (*vars.esym_table)) #define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (*vars.reltab)) #define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (*vars.int_reltab)) -#define SIZEOF_ILF_STRINGS (strlen (import_name) * 2 + 8 \ +#define SIZEOF_ILF_STRINGS (strlen (symbol_name) * 2 + 8 \ + 21 + strlen (source_dll) \ + NUM_ILF_SECTIONS * 9 \ + STRING_SIZE_SIZE) |