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/05/2012 10:06 AM, Kees Cook wrote:
> Would anyone else prefer it over the current fix?

I'd rather not impose an arbitrary limit here.

Come to think of it, though, the current implementation
*does* impose a limit, which could be defined by something
like this:

  #define NL_ARGMAX (SIZE_MAX / bytes_per_arg)

where an actual constant is needed instead of the expression
(so that NL_ARGMAX can be used within #if).  If we do this,
we'd need to consider the limit in scanf too, since NL_ARGMAX
applies to both.  But this is a low-priority nicety, surely.


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