227bb2b2ea
Avoid integer overflow and reading past EOF. MFC of r276427, r276443, r277249 from contrib/elftoolchain.
# $FreeBSD$ # $NetBSD$ libelf: a BSD-licensed implementation of the ELF(3)/GELF(3) API. Documentation: * Manual page elf.3 contains an overview of the library. Other manual pages document individual APIs in the library. * A tutorial "libelf by Example" is available at: http://people.freebsd.org/~jkoshy/download/libelf/article.html For ongoing development please see http://elftoolchain.sourceforge.net/