[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#609756: vsnprintf segfaults on second attempt with alloca



* Andrew Buckeridge:

> C99 only va_copy does help. This is a new one for me.
> Does vfnprint destroy the callers ap?

Yes, it does.  Not on all platforms, but on amd64, for example.
Passing va_list as an argument does not make a sufficiently deep copy,
so that va_arg in the callee affects subsequent va_arg invocations in
the caller.

> Does this break C89 and C90?

Some systems have got __va_copy.  There's probably an autoconf test
for this.

-- 
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99



Reply to: