[PATCH] Protect against integer overflow on shnum

Mark Wielaard mark@klomp.org
Thu Apr 27 18:24:00 GMT 2017


On Thu, Apr 20, 2017 at 04:04:54PM +0200, Ulf Hermann wrote:
> If shnum is 0, the many "shnum - 1" would result in an overflow. Check it
> for 0, and only subtract once, rather than on every usage.

Since in both cases this is for the prelink undo section which skips
the zero header this is a more natural way to express shnum.

Applied to master.

Thanks,

Mark



More information about the Elfutils-devel mailing list