From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 098293858426; Sat, 5 Feb 2022 00:46:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 098293858426 From: "sh200105 at mail dot ru" To: glibc-bugs-regex@sourceware.org Subject: [Bug regex/28864] Out of memory in regcomp() with many '+' characters in a row Date: Sat, 05 Feb 2022 00:46:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: regex X-Bugzilla-Version: 2.33 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sh200105 at mail dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs-regex@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs-regex mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2022 00:46:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28864 Alexander Kernozhitsky changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Out of memory in regcomp() |Out of memory in regcomp() |with many '+' changes in a |with many '+' characters in |row |a row --- Comment #1 from Alexander Kernozhitsky --- The following program runs out of memory when being run: #include #include int main() { const char *re =3D "C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++"; regex_t regex; if (regcomp(®ex, re, REG_NEWLINE | REG_EXTENDED)) { return EXIT_FAILURE; } return 0; } Steps to reproduce: Compile and run the source code above. Alternatively, the same bug is triggered when running `grep -E 'C++++++++++++++++++++++++++++++++++++++++++++++++'`. I am using glibc 2.33-5 from Debian packages. --=20 You are receiving this mail because: You are on the CC list for the bug.=