[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

STINNER Victor report at bugs.python.org
Wed Nov 23 04:21:43 EST 2016


STINNER Victor added the comment:

sre-concrete.patch is wrong: if groupindex is a subtype of dict, you should use PyObject_GetItem.

I like the idea of using PyDict_GetItem, you should just implement stricter checks in _sre.compile(). Maybe using PyDict_CheckExact?

Since it's a private module, we don't have to support all types. It's ok to implement further optimizations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28765>
_______________________________________


More information about the Python-bugs-list mailing list