diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-24 16:50:53 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-24 16:50:53 +0000 |
commit | cff31deb1a197b29ab976c135fdd01dfb6951a6a (patch) | |
tree | dbdcb15ce3419e48e823390b612d613ff00bd567 /lib/libelf/elf_data.c | |
parent | b4e24f9126f7a4c80ce0c44f6b4230021089bc1e (diff) | |
parent | 084e5da56e3c4bc6f9c6ed314310a9b8af2c695b (diff) | |
download | FreeBSD-src-cff31deb1a197b29ab976c135fdd01dfb6951a6a.zip FreeBSD-src-cff31deb1a197b29ab976c135fdd01dfb6951a6a.tar.gz |
MFC
Diffstat (limited to 'lib/libelf/elf_data.c')
-rw-r--r-- | lib/libelf/elf_data.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libelf/elf_data.c b/lib/libelf/elf_data.c index c34c4ad..d3bd390 100644 --- a/lib/libelf/elf_data.c +++ b/lib/libelf/elf_data.c @@ -78,8 +78,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && @@ -219,8 +221,10 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } - if (sh_type == SHT_NULL) + if (sh_type == SHT_NULL) { + LIBELF_SET_ERROR(SECTION, 0); return (NULL); + } if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); |