Skip to content

Commit ec9283a

Browse files
committed
remove tp_alloc() from Py_XINCREF comments. tp_alloc() can no longer run arbitrary code since 3.15.
`get_dialect_from_registry()` calls `PyDict_GetItemRef()` which can run arbitrary overloaded `__eq__` or `__hash__` code when comparing keys.
1 parent 14ad9f0 commit ec9283a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Modules/_csv.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ dialect_new_impl(PyTypeObject *type, PyObject *dialect, PyObject *delimiter,
500500
PyObject *ret = NULL;
501501

502502
/* vectorcall passes borrowed references; hold strong references before
503-
get_dialect_from_registry() or tp_alloc() can run arbitrary Python. */
503+
get_dialect_from_registry() can run arbitrary Python. */
504504
Py_XINCREF(delimiter);
505505
Py_XINCREF(doublequote);
506506
Py_XINCREF(escapechar);

0 commit comments

Comments
 (0)