public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
From: "dpmendenhall at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs-regex@sourceware.org
Subject: [Bug regex/25814] New: Consecutive + operators accepted but have no effect except consuming more memory
Date: Sun, 12 Apr 2020 04:06:37 +0000	[thread overview]
Message-ID: <bug-25814-132@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=25814

            Bug ID: 25814
           Summary: Consecutive + operators accepted but have no effect
                    except consuming more memory
           Product: glibc
           Version: 2.27
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: regex
          Assignee: unassigned at sourceware dot org
          Reporter: dpmendenhall at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 12452
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12452&action=edit
test program

The attached test program just takes a regex pattern and a string at the
command line.

$ gcc -o regex regex.c
$ ./regex 0+ 0
pattern: 0+
string: 0

regex matched
$ ./regex 0++ 0
pattern: 0++
string: 0

regex matched
$ ./regex 0++++++++++++++++++++++++++++++++++ 0
pattern: 0++++++++++++++++++++++++++++++++++
string: 0
<hangs consuming all system memory>

I'm not even sure what consecutive + operators is supposed to mean, so I don't
know why "0++" accepts "0".

I tested this against the bionic/NetBSD regex implementation and compilation of
"0++" fails with REG_BADRPT, which makes more sense.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2020-04-12  4:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12  4:06 dpmendenhall at gmail dot com [this message]
2020-04-12 11:55 ` [Bug regex/25814] " schwab@linux-m68k.org
2020-04-12 12:15 ` schwab@linux-m68k.org
2020-04-13  2:58 ` dpmendenhall at gmail dot com
2020-04-13  2:59 ` dpmendenhall at gmail dot com
2020-04-13  3:02 ` dpmendenhall at gmail dot com
2020-04-13 11:05 ` schwab@linux-m68k.org
2020-04-13 15:35 ` dpmendenhall at gmail dot com
2020-04-15 15:53 ` dpmendenhall at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25814-132@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs-regex@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).