libelf: add an assert that msz is non-zero

Reported by:	Coverity
CID:		976023
This commit is contained in:
Ed Maste 2017-04-10 19:22:15 +00:00
parent e592841459
commit f2911fa4a3

View File

@ -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);