diff options
| author | Kai Wang <kaiw@FreeBSD.org> | 2011-05-07 11:04:36 +0000 |
|---|---|---|
| committer | Kai Wang <kaiw@FreeBSD.org> | 2011-05-07 11:04:36 +0000 |
| commit | 08a7f479dd4fcded774045e1526f8b4941959a3c (patch) | |
| tree | 032e88dcc018db73050ad071b1d733762cb027f4 /lib/libelf | |
| parent | 3860fcc7f07c2d92b5e5a99d92a2cbd3081e8acf (diff) | |
Notes
Diffstat (limited to 'lib/libelf')
| -rw-r--r-- | lib/libelf/elf_data.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libelf/elf_data.c b/lib/libelf/elf_data.c index b8c10de0ac20..c34c4ad358b2 100644 --- a/lib/libelf/elf_data.c +++ b/lib/libelf/elf_data.c @@ -225,7 +225,8 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); - d->d_buf = sh_type == SHT_NOBITS ? NULL : e->e_rawfile + sh_offset; + d->d_buf = (sh_type == SHT_NOBITS || sh_size == 0) ? NULL : + e->e_rawfile + sh_offset; d->d_off = 0; d->d_align = sh_align; d->d_size = sh_size; |
