[PATCH] vfprint: validate nargs and argument-based offsets
Paul Eggert
eggert@cs.ucla.edu
Mon Mar 5 18:38:00 GMT 2012
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.
More information about the Libc-alpha
mailing list