mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue