From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15936 invoked by alias); 30 Mar 2004 15:44:37 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15818 invoked from network); 30 Mar 2004 15:44:33 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 30 Mar 2004 15:44:33 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i2UFiU1X002596 for ; Tue, 30 Mar 2004 10:44:30 -0500 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i2UFiTj27204; Tue, 30 Mar 2004 10:44:29 -0500 To: Ulrich Weigand Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix invalid use of va_list References: <200403301336.PAA17124@faui1d.informatik.uni-erlangen.de> From: Jim Blandy Date: Tue, 30 Mar 2004 15:44:00 -0000 In-Reply-To: <200403301336.PAA17124@faui1d.informatik.uni-erlangen.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-03/txt/msg00747.txt.bz2 Looks good (obvious). This is not a legally significant change, so I'll just commit it. Thanks! Ulrich Weigand 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.