summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-03 00:47:39 -0700
committerGitHub <noreply@github.com>2022-11-03 00:47:39 -0700
commiteb023a84d92661bcde9dfe1641576774710f6c64 (patch)
tree4fcd7f3a5c2b43523d1c7943be35cf5aade190fd /Python
parenta02979fa48103a84f635ce06bd01d5437c39f60c (diff)
downloadpython-eb023a84d92661bcde9dfe1641576774710f6c64.tar.gz
python-eb023a84d92661bcde9dfe1641576774710f6c64.zip
gh-98740: Fix validation of conditional expressions in RE (GH-98764)
In very rare circumstances the JUMP opcode could be confused with the argument of the opcode in the "then" part which doesn't end with the JUMP opcode. This led to incorrect detection of the final JUMP opcode and incorrect calculation of the size of the subexpression. NOTE: Changed return value of functions _validate_inner() and _validate_charset() in Modules/_sre/sre.c. Now they return 0 on success, -1 on failure, and 1 if the last op is JUMP (which usually is a failure). Previously they returned 1 on success and 0 on failure. (cherry picked from commit e9ac890c0273aee413aa528cc202c3efa29f1d7a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions