mirror of https://github.com/python/cpython.git
Add test for failure of the getattr call in pcre_expand() -- it used
to core dump if the first argument did not have a "group" attribute.
This commit is contained in:
parent
0e5ab17ad3
commit
1a78553093
|
@ -512,6 +512,10 @@ PyPcre_expand(self, args)
|
|||
{
|
||||
PyObject *r, *tuple, *result;
|
||||
r=PyObject_GetAttrString(match_obj, "group");
|
||||
if (r == NULL) {
|
||||
Py_DECREF(results);
|
||||
return NULL;
|
||||
}
|
||||
tuple=PyTuple_New(1);
|
||||
Py_INCREF(value);
|
||||
PyTuple_SetItem(tuple, 0, value);
|
||||
|
|
Loading…
Reference in New Issue