[New-bugs-announce] [issue2443] uninitialized access to va_list

Rolland Dudemaine report at bugs.python.org
Fri Mar 21 11:27:38 CET 2008


New submission from Rolland Dudemaine <rolland at ghs.com>:

In many files, the following code is present (with slight variations,
but the important part is there) :
static PyObject *
objargs_mktuple(va_list va)
{
	int i, n = 0;
	va_list countva;
	PyObject *result, *tmp;

#ifdef VA_LIST_IS_ARRAY
	memcpy(countva, va, sizeof(va_list));
#else
#ifdef __va_copy
	__va_copy(countva, va);
#else
	countva = va;
#endif
#endif

...

memcpy() is accessing va_list before it is initialized.

Before the first access to a va_list type variable, and after the last
access to that variable, calls to va_start() and va_end() must be made
to initialize and free the variable.

Such behaviour should be corrected in the following files :
- Objects/abstract.c, line 1901
- Objects/stringobject.c, line 162
- getargs.c, line 66
- getargs.c, line 1188
- modsupport.c, line 479

----------
components: Build
messages: 64234
nosy: rolland
severity: normal
status: open
title: uninitialized access to va_list
type: compile error
versions: Python 2.5, Python 2.6, Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2443>
__________________________________


More information about the New-bugs-announce mailing list