[pypy-issue] [issue1241] [cpyext] PyUnicode_Tailmatch() fails to match with high end bounds

Stefan Behnel tracker at bugs.pypy.org
Thu Aug 23 16:30:26 CEST 2012


New submission from Stefan Behnel <stefan_ml at behnel.de>:

When calling PyUnicode_Tailmatch() with an end bound beyond the length of the
haystack string, the internal implementation incorrectly interprets that as the
length of the string and fails to match. This is because it directly calls
stringendswith(), whereas the Python level .endswith() method first crops the
bounds and only then calls into stringendswith().

I'm sure a similar situation can be constructed for the opposite direction that
calls stringstartswith().

----------
messages: 4670
nosy: pypy-issue, sbehnel
priority: bug
status: unread
title: [cpyext] PyUnicode_Tailmatch() fails to match with high end bounds

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1241>
________________________________________


More information about the pypy-issue mailing list