Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 82869 - SIGSEGV in vsnprintf() in vi_VN.tcvn locale
Summary: SIGSEGV in vsnprintf() in vi_VN.tcvn locale
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 8.0
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-27 23:04 UTC by Martin Sebor
Modified: 2016-11-24 14:52 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-03 11:48:21 UTC


Attachments (Terms of Use)

Description Martin Sebor 2003-01-27 23:04:21 UTC
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 11:48:21 UTC
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.