mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 18:44:20 +08:00
2012-12-13 Pedro Alves <palves@redhat.com>
* coff-pe-read.c: Include coff/internal.h. (read_pe_exported_syms): Use SCNNMLEN instead of hardcoded 8. Null terminate buffer explicitly instead of memset the whole buffer.
This commit is contained in:
parent
78ea0eca85
commit
aab2f00472
@ -1,3 +1,10 @@
|
|||||||
|
2012-12-13 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* coff-pe-read.c: Include coff/internal.h.
|
||||||
|
(read_pe_exported_syms): Use SCNNMLEN instead of hardcoded 8.
|
||||||
|
Null terminate buffer explicitly instead of memset the whole
|
||||||
|
buffer.
|
||||||
|
|
||||||
2012-12-13 Pierre Muller <muller@sourceware.org>
|
2012-12-13 Pierre Muller <muller@sourceware.org>
|
||||||
|
|
||||||
* coff-pe-read.c (IMAGE_SCN_CNT_TEXT, IMAGE_SCN_CNT_INITIALIZED_DATA)
|
* coff-pe-read.c (IMAGE_SCN_CNT_TEXT, IMAGE_SCN_CNT_INITIALIZED_DATA)
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "symfile.h"
|
#include "symfile.h"
|
||||||
#include "objfiles.h"
|
#include "objfiles.h"
|
||||||
#include "common/common-utils.h"
|
#include "common/common-utils.h"
|
||||||
|
#include "coff/internal.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@ -458,12 +459,12 @@ read_pe_exported_syms (struct objfile *objfile)
|
|||||||
unsigned long vsize = pe_get32 (dll, secptr1 + 8);
|
unsigned long vsize = pe_get32 (dll, secptr1 + 8);
|
||||||
unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
|
unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
|
||||||
unsigned long characteristics = pe_get32 (dll, secptr1 + 36);
|
unsigned long characteristics = pe_get32 (dll, secptr1 + 36);
|
||||||
char sec_name[9];
|
char sec_name[SCNNMLEN + 1];
|
||||||
int sectix;
|
int sectix;
|
||||||
|
|
||||||
memset (sec_name, 0, sizeof (sec_name));
|
|
||||||
bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
|
bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
|
||||||
bfd_bread (sec_name, (bfd_size_type) 8, dll);
|
bfd_bread (sec_name, (bfd_size_type) SCNNMLEN, dll);
|
||||||
|
sec_name[SCNNMLEN] = '\0';
|
||||||
|
|
||||||
sectix = read_pe_section_index (sec_name);
|
sectix = read_pe_section_index (sec_name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user