This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Fix invalid use of va_list
- From: Jim Blandy <jimb at redhat dot com>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: gdb-patches at sources dot redhat dot com
- Date: 30 Mar 2004 10:43:41 -0500
- Subject: Re: [PATCH] Fix invalid use of va_list
- References: <200403301336.PAA17124@faui1d.informatik.uni-erlangen.de>
Looks good (obvious). This is not a legally significant change, so
I'll just commit it.
Thanks!
Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
> Hello,
>
> gdb crashes on s390 when the user answers a (y or n) question with
> something else. This is caused by the 'query' function reusing a
> va_list variable initialized only once multiple times.
>
> This is not allowed according to the C standard (C99 7.15.3), and
> in fact doesn't work on platforms that define va_list as an array
> type.
>
> The patch below changes query to reinitialize the va_list variable
> with va_start before each use.
>
> Tested on s390-ibm-linux.
>
> ChangeLog:
>
> * utils.c (query): Do not use a va_list variable multiple times.