summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2017-05-03 02:37:44 +0000
committeremaste <emaste@FreeBSD.org>2017-05-03 02:37:44 +0000
commit81d573b54197a04eba095385616230a9712c77c2 (patch)
tree87da0b59c7bb22910d83174ae63d95d11ee949e8 /contrib/elftoolchain
parentc20bdaf8573b5949f6cd0fc88d99b48463d23607 (diff)
downloadFreeBSD-src-81d573b54197a04eba095385616230a9712c77c2.zip
FreeBSD-src-81d573b54197a04eba095385616230a9712c77c2.tar.gz
MFC r316685: libelf: add an assert that msz is non-zero
Reported by: Coverity CID: 976023 Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r--contrib/elftoolchain/libelf/elf_update.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/elftoolchain/libelf/elf_update.c b/contrib/elftoolchain/libelf/elf_update.c
index 6cc109d..0c44712 100644
--- a/contrib/elftoolchain/libelf/elf_update.c
+++ b/contrib/elftoolchain/libelf/elf_update.c
@@ -808,6 +808,7 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex)
assert(d->d_buf != NULL);
assert(d->d_version == e->e_version);
+ assert(msz != 0);
assert(d->d_size % msz == 0);
nobjects = (size_t) (d->d_size / msz);
OpenPOWER on IntegriCloud