You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect handling of start and end values in codecs error handlers #126004
See #123378 for the root cause. Since we are still wondering how to fix the getters and setters, I suggest we first fix the crash by adding the checks inside at the handler's level (for now). I'm not sure if the handler itself is handling corner cases correctly as well.
changed the title [-]Incorrect handling of `start` and `end` values in `codecs.xmlcharrefreplace_errors` handler[/-][+]Incorrect handling of `start` and `end` values in `codecs` error handlers[/+]on Nov 29, 2024
FTR: I prepared three branches that fix (and cleanup) the error handlers.
Those branches include #123380 and thus I'll wait for the latter to be merged since otherwise there will be a crash even before the actual "bad" code happens.
The fixes are actually quite straightforward: there is actually no check on the consistency of start and end after they've been retrieved via *GetStart and *GetEnd, and this leads to OOB issues or other kind of issues. So, even if we fix the getters, we still need to handle the consistency of the bounds.
Activity
[-]Incorrect handling of `start` and `end` values in `codecs.xmlcharrefreplace_errors` handler[/-][+]Incorrect handling of `start` and `end` values in `codecs` error handlers[/+]picnixz commentedon Nov 29, 2024
FTR: I prepared three branches that fix (and cleanup) the error handlers.
Those branches include #123380 and thus I'll wait for the latter to be merged since otherwise there will be a crash even before the actual "bad" code happens.
The fixes are actually quite straightforward: there is actually no check on the consistency of
startandendafter they've been retrieved via*GetStartand*GetEnd, and this leads to OOB issues or other kind of issues. So, even if we fix the getters, we still need to handle the consistency of the bounds.cc @encukou
picnixz commentedon Dec 6, 2024
Since #123378 is only 3.14+ (not backported), the fixes for those handlers will also be 3.14+ only.
gh-126004: Fix positions handling in `codecs.xmlcharrefreplace_errors` (
gh-126004: Fix positions handling in `codecs.replace_errors` (#127674)
gh-126004: Fix positions handling in `codecs.backslashreplace_errors` (…
gh-126004: Remove redundant safeguards for codecs handlers tests (#12…