This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] vfprint: validate nargs and argument-based offsets
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Kees Cook <kees at outflux dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 02 Mar 2012 11:10:13 -0800
- Subject: Re: [PATCH] vfprint: validate nargs and argument-based offsets
- References: <20120302185346.GE3990@outflux.net>
On 03/02/2012 10:53 AM, Kees Cook wrote:
> + if (nargs > SIZE_MAX / bytes_per_arg)
> + {
> + done = -1;
> + goto all_done;
> + }
I just noticed: isn't vfprintf supposed to set errno on failure?
The above code neglects to do that.
Presumably it should set errno to ENOMEM,
using __set_errno.