cpython/Modules/_sre
Miss Islington (bot) eb023a84d9
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 e9ac890c02)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-03 00:47:39 -07:00
..
clinic gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (GH-93882) 2022-06-17 01:43:56 -07:00
sre.c gh-98740: Fix validation of conditional expressions in RE (GH-98764) 2022-11-03 00:47:39 -07:00
sre.h gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (GH-93882) 2022-06-17 01:43:56 -07:00
sre_constants.h gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (GH-93882) 2022-06-17 01:43:56 -07:00
sre_lib.h gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or allocation failure (GH-32283) (GH-93882) 2022-06-17 01:43:56 -07:00
sre_targets.h gh-91870: Remove unsupported SRE opcode CALL (GH-91872) 2022-04-26 21:07:25 +03:00