patches/glibc/2.9/150-regex-BZ697.patch
branchnewlib
changeset 1365 c4d124ed9f8e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.9/150-regex-BZ697.patch	Sun Apr 19 16:17:11 2009 +0000
     1.3 @@ -0,0 +1,28 @@
     1.4 +Original patch from: gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch
     1.5 +
     1.6 +-= BEGIN original header =-
     1.7 +http://sourceware.org/ml/libc-alpha/2009-01/msg00006.html
     1.8 +
     1.9 +From 37bdc055ceeb6b1144c07448a7210d9ab3fbb2f5 Mon Sep 17 00:00:00 2001
    1.10 +From: Ulrich Drepper <drepper@redhat.com>
    1.11 +Date: Thu, 8 Jan 2009 00:47:05 +0000
    1.12 +Subject: [PATCH] (prune_impossible_nodes): Handle sifted_states[0] being NULL also if
    1.13 + there are no backreferences.
    1.14 +
    1.15 +-= END original header =-
    1.16 +
    1.17 +diff -durN glibc-2_9.orig/posix/regexec.c glibc-2_9/posix/regexec.c
    1.18 +--- glibc-2_9.orig/posix/regexec.c	2007-10-12 19:47:13.000000000 +0200
    1.19 ++++ glibc-2_9/posix/regexec.c	2009-02-02 22:00:43.000000000 +0100
    1.20 +@@ -1004,6 +1004,11 @@
    1.21 +       re_node_set_free (&sctx.limits);
    1.22 +       if (BE (ret != REG_NOERROR, 0))
    1.23 + 	goto free_return;
    1.24 ++      if (sifted_states[0] == NULL)
    1.25 ++	{
    1.26 ++	  ret = REG_NOMATCH;
    1.27 ++	  goto free_return;
    1.28 ++	}
    1.29 +     }
    1.30 +   re_free (mctx->state_log);
    1.31 +   mctx->state_log = sifted_states;