This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] Protect against integer overflow on shnum
- From: Mark Wielaard <mark at klomp dot org>
- To: Ulf Hermann <ulf dot hermann at qt dot io>
- Cc: elfutils-devel at sourceware dot org
- Date: Thu, 27 Apr 2017 19:51:34 +0200
- Subject: Re: [PATCH] Protect against integer overflow on shnum
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
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.