From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18565 invoked by alias); 11 Oct 2002 00:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18532 invoked by uid 71); 11 Oct 2002 00:16:02 -0000 Resent-Date: 11 Oct 2002 00:16:02 -0000 Resent-Message-ID: <20021011001602.18529.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, finch@clara.co.uk Received: (qmail 16479 invoked by uid 61); 11 Oct 2002 00:13:04 -0000 Message-Id: <20021011001304.16478.qmail@sources.redhat.com> Date: Thu, 10 Oct 2002 17:16:00 -0000 From: finch@clara.co.uk Reply-To: finch@clara.co.uk To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/8194: sprintf causes segfaults X-SW-Source: 2002-10/txt/msg00435.txt.bz2 List-Id: >Number: 8194 >Category: c >Synopsis: sprintf causes segfaults >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Oct 10 17:16:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Gabriel Finch >Release: unknown-1.0 >Organization: >Environment: gcc -v Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib Thread model: posix gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk) >Description: The following code causes a segfault on exit when compiled with gcc and run: #include int main() { char *i,*s; sprintf(s,"%s","a"); // any format string works here sprintf(i,"xx%s",s); // must be 2 or more chars before %s return 0; } >How-To-Repeat: Compile above code with gcc and execute it. >Fix: >Release-Note: >Audit-Trail: >Unformatted: