Skip to content

_selectmodule.c does not handle errors when creating a module #111233

Closed
@sobolevn

Description

@sobolevn

Bug report

It is documented that PyModule_AddIntMacro can raise an error (and it can in fact):

.. c:macro:: PyModule_AddIntMacro(module, macro)

   Return ``-1`` on error, ``0`` on success.

But, some calls are not checked for errors:

cpython/Modules/selectmodule.c

Lines 2471 to 2476 in 96cbd1e

PyModule_AddIntMacro(m, POLLIN);
PyModule_AddIntMacro(m, POLLPRI);
PyModule_AddIntMacro(m, POLLOUT);
PyModule_AddIntMacro(m, POLLERR);
PyModule_AddIntMacro(m, POLLHUP);
PyModule_AddIntMacro(m, POLLNVAL);

Linked PRs

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions