Commit [62f88c] legacy-trunk Maximize Restore History

Fixed sre bug "[#581080] Provoking infinite scanner loops".

This bug happened because: 1) the scanner_search and scanner_match methods
were not checking the buffer limits before increasing the current pointer;
and 2) SRE_SEARCH was using "if (ptr == end)" as a loop break, instead of
"if (ptr >= end)".

* Modules/_sre.c
(SRE_SEARCH): Check for "ptr >= end" to break loops, so that we don't
hang forever if a pointer passing the buffer limit is used.
(scanner_search,scanner_match): Don't increment the current pointer
if we're going to pass the buffer limit.

* Misc/NEWS
Mention the fix.

Gustavo Niemeyer Gustavo Niemeyer 2002-11-07

changed Misc/NEWS
changed Modules/_sre.c
Misc/NEWS Diff Switch to side-by-side view
Loading...
Modules/_sre.c Diff Switch to side-by-side view
Loading...