[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
regcomp(3) incorrectly handles chars with 8th bit set in format string
From: |
Vlad Harchev |
Subject: |
regcomp(3) incorrectly handles chars with 8th bit set in format string |
Date: |
Fri, 3 Aug 2001 22:05:19 +0500 (SAMST) |
Hi,
Sorry, I can't provide you with exact version number of glibc (I'm writing
from other place, not from where I got a bug) - but it's about glibc shipped
with non-upgraded (vanilla) RedHat 7.1 on x86.
Bugreport itself:
regcomp(3) incorrectly handles characters with 8th bit set in format string.
This leads to crash (due to a bug in wctomb - I've reported it to you in
other message).
Here is a backtrace (sorry for extra quoting):
> > (no debugging symbols found)...0x40864519 in __wait4 ()
> > from /lib/i686/libc.so.6
> > #0 0x40864519 in __wait4 () from /lib/i686/libc.so.6
> > #1 0x408d49e4 in __DTOR_END__ () from /lib/i686/libc.so.6
> > #2 0x404a3262 in gnome_segv_handle (signum=11) at gnome-init.c:659
> > #3 <signal handler called>
> > #4 0x40956f73 in gconv () from /usr/lib/gconv/KOI8-R.so
> > #5 0x4083688a in __wcrtomb (s=0xbffff590 "\210\002", wc=-15,
> > ps=0x408d8aa0)
> > at wcrtomb.c:85
> > #6 0x407da8cf in wctomb (s=0xbffff590 "\210\002", wchar=-15) at
> > wctomb.c:53
> > #7 0x40875bd8 in __re_compile_fastmap (bufp=0xbffff630) at regex.c:4567
> > #8 0x40879c24 in __regcomp (preg=0xbffff630,
> > pattern=0x8201720
> >
"^(Янв|Фев|Мар|Апр|Май|Июн|Июл|Авг|Сен|Окт|Ноя|Дек)-([0-9][0-9]?)-([0-9][0-9]?)$",
> > cflags=3) at regex.c:7745
I assume that macro regcomp expands to __regcomp because frame #9 is about
user function.
It's under ru_RU.KOI8-R locale (but I guess under any locale it will be the
same).
Solution:
Instead of
(wchar_t)some_character
use
(wchar_t)(unsigned char)some_character
This way
wctomb will get a positive argument.
But wctomb also needs fixing.
Thanks for developing glibc!
Best regards,
-Vlad
- regcomp(3) incorrectly handles chars with 8th bit set in format string,
Vlad Harchev <=