bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] regex: fix match with possessive quantifier


From: Dmitry V. Levin
Subject: Re: [PATCH] regex: fix match with possessive quantifier
Date: Mon, 7 Jun 2021 04:10:27 +0300

On Mon, Jun 07, 2021 at 12:45:02AM +0300, Dmitry V. Levin wrote:
> On Wed, May 26, 2021 at 12:08:19PM +0300, Egor Ignatov wrote:
> > Fix behaviour introduced in 70b673e, where regexps with
> > possessive quantifier("*+") didn't match.
> > * lib/regexec.c
> > (set_regs): Pop if CUR_NODE has already been checked only when
> > we have a fail stack.
> > 
> > Signed-off-by: Egor Ignatov <egori@altlinux.org>
> > ---
> > Hi Paul,
> > 
> > Do you have any test cases for bug 11053(glibc) for gnulib?
> > This patch fixes the issue with "*+", but I'm not sure it
> > doesn't break your fix for 11053.
> 
> Thanks, the fix looks plausible, it doesn't break any tests
> (including those introduced along with commit 70b673eb7),

Apparently, there are more issues with commit 70b673eb7, for example:

$ echo ab | sed -E 's/^(a*)*(.)\1/\1/'
Segmentation fault

$ echo ab | strace -enone -- sed --debug -E 's/^(a*)*(.)\1/\1/'
SED PROGRAM:
  s/^(a*)*(.)\\1/\1/
INPUT:   'STDIN' line 1
PATTERN: ab
COMMAND: s/^(a*)*(.)\\1/\1/
MATCHED REGEX REGISTERS
  regex[0] = 0-2 'ab'
  regex[1] = 0--1 'ab!!ab
'
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x20} ---
+++ killed by SIGSEGV +++
Segmentation fault


-- 
ldv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]