[PATCH] vfprint: validate nargs and argument-based offsets

Paul Eggert eggert@cs.ucla.edu
Fri Mar 2 19:10:00 GMT 2012


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.



More information about the Libc-alpha mailing list