From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 Description of problem: The program below fails with a SIGSEGV. $ cat t.cpp; uname -a; gcc --version; gcc t.cpp && ./a.out #include <stdio.h> #include <stdarg.h> #include <locale.h> int foo (char *buf, const char *s, ...) { va_list va; va_start (va, s); int n = vsprintf (buf, s, va); va_end (va); return n; } int main () { printf ("glibc %d.%d\n", __GLIBC__, __GLIBC_MINOR__); setlocale (LC_ALL, "vi_VN.tcvn"); const char *a = ""; const char *b = "Th"; char buf [256]; foo (buf, "%s%.*s", a, 2, b); } Linux stalwart.cvo.roguewave.com 2.4.18-14smp #1 SMP Wed Sep 4 12:34:47 EDT 2002 i686 i686 i386 GNU/Linux gcc (GCC) 3.2 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. glibc 2.3 Segmentation fault Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. compile and run the program Additional info:
Should be fixed in glibc-2.3.1-40 and above.