Skip to content

[3.15] gh-160316: Make re.Pattern.match() return None when pos > endpos (GH-160317) - #161043

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-6b58f9a-3.15
Open

miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-6b58f9a-3.15

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

gh-160316: Make re.Pattern.match() return None when pos > endpos

Pattern.match(), prefixmatch(), fullmatch() and the scanner match() ran
the engine with the start position past the end position, which could
return an empty match or read past the end of the string.

ANT-2026-NMTUWIC8
(cherry picked from commit 6b58f9a)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

…endpos` (pythonGH-160317)

pythongh-160316: Make re.Pattern.match() return None when pos > endpos

Pattern.match(), prefixmatch(), fullmatch() and the scanner match() ran
the engine with the start position past the end position, which could
return an empty match or read past the end of the string.

ANT-2026-NMTUWIC8
(cherry picked from commit 6b58f9a)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants