summaryrefslogtreecommitdiff
path: root/libelf/lib/32.newehdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/lib/32.newehdr.c')
-rwxr-xr-xlibelf/lib/32.newehdr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libelf/lib/32.newehdr.c b/libelf/lib/32.newehdr.c
index ecfcc54b1..dc0c6c283 100755
--- a/libelf/lib/32.newehdr.c
+++ b/libelf/lib/32.newehdr.c
@@ -39,7 +39,9 @@ _elf_newehdr(Elf *elf, unsigned cls)
return _elf_getehdr(elf, cls);
}
else if (!elf->e_ehdr) {
+/*@-boundsread@*/
size = _msize(cls, _elf_version, ELF_T_EHDR);
+/*@=boundsread@*/
elf_assert(size);
if ((elf->e_ehdr = (char*)malloc(size))) {
memset(elf->e_ehdr, 0, size);
@@ -75,10 +77,12 @@ elf64_newehdr(Elf *elf) {
unsigned long
gelf_newehdr(Elf *elf, int cls) {
+/*@-boundsread@*/
if (!valid_class(cls) || !_msize(cls, _elf_version, ELF_T_EHDR)) {
seterr(ERROR_UNKNOWN_CLASS);
return 0;
}
+/*@=boundsread@*/
if (!_elf_newehdr(elf, cls)) {
return 0;
}