mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-02-10 19:24:29 +00:00
* coff-pe-read.c (pe_text_section_offset): Increase size of sname
local variable and zero terminate it to avoid possible problems in strcmp.
This commit is contained in:
parent
aab2f00472
commit
d8f4a83e6a
@ -1,3 +1,9 @@
|
||||
2012-12-13 Pierre Muller <muller@sourceware.org>
|
||||
|
||||
* coff-pe-read.c (pe_text_section_offset): Increase size of sname
|
||||
local variable and zero terminate it to avoid possible problems
|
||||
in strcmp.
|
||||
|
||||
2012-12-13 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* coff-pe-read.c: Include coff/internal.h.
|
||||
|
@ -672,12 +672,13 @@ pe_text_section_offset (struct bfd *abfd)
|
||||
/* Get the rva and size of the export section. */
|
||||
for (i = 0; i < nsections; i++)
|
||||
{
|
||||
char sname[8];
|
||||
char sname[SCNNMLEN + 1];
|
||||
unsigned long secptr1 = secptr + 40 * i;
|
||||
unsigned long vaddr = pe_get32 (abfd, secptr1 + 12);
|
||||
|
||||
bfd_seek (abfd, (file_ptr) secptr1, SEEK_SET);
|
||||
bfd_bread (sname, (bfd_size_type) 8, abfd);
|
||||
bfd_bread (sname, (bfd_size_type) SCNNMLEN, abfd);
|
||||
sname[SCNNMLEN] = '\0';
|
||||
if (strcmp (sname, ".text") == 0)
|
||||
return vaddr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user