This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Was: [2 BUGs] posix/regcomp.c (2.3.2 and 2.3.3-2003-12-18)
- From: Rene Rebe <rene dot rebe at gmx dot net>
- To: libc-alpha at sources dot redhat dot com
- Cc: bug-glibc at gnu dot org, tcr at freebits dot de, rock-linux at rocklinux dot org
- Date: Sun, 21 Dec 2003 02:38:34 +0100 (CET)
- Subject: [PATCH] Was: [2 BUGs] posix/regcomp.c (2.3.2 and 2.3.3-2003-12-18)
- References: <20031221.020759.730563042.rene.rebe@gmx.net>
Hi,
On: Sun, 21 Dec 2003 02:07:59 +0100 (CET),
Rene Rebe <rene.rebe@gmx.net> wrote:
[...]
> The second is simillar but happening at a different place:
>
> grep -E -q '^[^#]*\bflistdel'
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0ff5d69c in calc_eclosure_iter (new_set=0x7ffff528, dfa=0x10024218, node=20,
> root=0) at regcomp.c:1578
> 1578 if (constraint && dfa->nodes[dfa->edests[node].elems[0]].duplicated)
[...]
> I try to add some workarounds - but since I'm not familiar with
> glibc's regex code it would be nice if some author could take a look
> ...
Ok - here goes a workaround which fixes the seg-fault but since I have
not the big picture of the regex code might only fix the syntoms ...
--- glibc-2.3.3-2003-12-18/posix/regcomp.c 2003-12-16 07:10:51.000000000 +0100
+++ glibc-2.3.3-2003-12-18-fixed/posix/regcomp.c 2003-12-21 01:26:01.000000000 +0100
@@ -1575,7 +1575,8 @@
? dfa->nodes[node].opr.ctx_type : 0);
/* If the current node has constraints, duplicate all nodes.
Since they must inherit the constraints. */
- if (constraint && !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
+ if (constraint && dfa->edests[node].nelem &&
+ !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
{
int org_node, cur_node;
org_node = cur_node = node;
Sincerely yours,
René Rebe
- ROCK Linux stable release maintainer
--
René Rebe - Europe/Germany/Berlin
rene@rocklinux.org rene@rocklinux-consulting.de
http://www.rocklinux.org http://www.rocklinux-consulting.de
http://gsmp.tfh-berlin.de/gsmp http://gsmp.tfh-berlin.de/rene