This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]