Skip to content

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

Closed

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

Activity

  1. self-assigned this
    on Oct 23, 2023
  2. added a commit that references this issue on Oct 23, 2023
  3. added a commit that references this issue on Oct 25, 2023
  4. hugovk commented on Nov 9, 2023

    @hugovk
    Member

    Thanks!

  5. added a commit that references this issue on Feb 11, 2024
  6. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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