Bug 82869 - SIGSEGV in vsnprintf() in vi_VN.tcvn locale
SIGSEGV in vsnprintf() in vi_VN.tcvn locale
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
8.0
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-27 18:04 EST by Martin Sebor
Modified: 2007-04-18 12:50 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-03 06:48:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Martin Sebor 2003-01-27 18:04:21 EST
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:
Comment 1 Jakub Jelinek 2003-02-03 06:48:21 EST
Should be fixed in glibc-2.3.1-40 and above.

Note You need to log in before you can comment on or make changes to this bug.