From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13262 invoked by alias); 12 May 2004 11:52:46 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 13246 invoked from network); 12 May 2004 11:52:45 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 12 May 2004 11:52:45 -0000 Received: from hermes.suse.de (Hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 97C775968E1 for ; Wed, 12 May 2004 13:50:36 +0200 (CEST) To: libc-hacker@sources.redhat.com Subject: Fix regexp compiler with translation table From: Andreas Schwab X-Yow: SANTA CLAUS comes down a FIRE ESCAPE wearing bright blue LEG WARMERS.. He scrubs the POPE with a mild soap or detergent for 15 minutes, starring JANE FONDA!! Date: Wed, 12 May 2004 11:52:00 -0000 Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-05/txt/msg00023.txt.bz2 build_wcs_buffer didn't set mbs when a translation table is used. This can result in all kinds of random behaviour during parsing due to use of uninitialized memory. 2004-05-12 Andreas Schwab * posix/regex_internal.c (build_wcs_buffer): Also set pstr->mbs when translating. --- posix/regex_internal.c 26 Feb 2004 12:03:50 +0100 1.40 +++ posix/regex_internal.c 12 May 2004 13:46:04 +0200 @@ -242,7 +242,7 @@ build_wcs_buffer (pstr) for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) { ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i]; - buf[i] = pstr->trans[ch]; + buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch]; } p = (const char *) buf; } Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."