public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix regexp compiler with translation table
@ 2004-05-12 11:52 Andreas Schwab
  2004-05-12 12:03 ` Jakub Jelinek
  2004-05-17 18:20 ` Ulrich Drepper
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Schwab @ 2004-05-12 11:52 UTC (permalink / raw)
  To: libc-hacker

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  <schwab@suse.de>

	* 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."

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-17 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-12 11:52 Fix regexp compiler with translation table Andreas Schwab
2004-05-12 12:03 ` Jakub Jelinek
2004-05-12 12:42   ` Andreas Schwab
2004-05-17 18:20 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).