Jim Meyering wrote:
> >> Do we have a guarantee that that array dimension is reasonable?
> >
> > Yes. While msgctxt and msgid normally rarely exceed 1 KB (because
> 
> That sounds like convention.  Is there a guarantee?
No, there is no guarantee. It's the programmer's responsibility to pass
only sensible arguments to this function.

> What I was wondering is whether there were some guard, say
> in all callers, that would prevent VLA abuse.

No, there isn't. The msgid and msgctxt are meant to be literal strings.
Even malicious abusers of a program cannot turn string literals into
multi-megabyte monsters that would lead to stack overflow.

Bruno
-- 
In memoriam Fred Hampton <http://en.wikipedia.org/wiki/Fred_Hampton>

Reply via email to