Skip to content

cursesmodule uses winobj which might be NULL #123913

Closed as not planned
Closed as not planned

Description

@sobolevn

Bug report

Here's the problematic code:

winobj = (PyCursesWindowObject *)PyCursesWindow_New(win, NULL);
screen_encoding = winobj->encoding;
return (PyObject *)winobj;

Why is it problematic? Because PyCursesWindow_New can return NULL here:

if (wo->encoding == NULL) {
Py_DECREF(wo);
PyErr_NoMemory();
return NULL;
}

So, winobj->encoding of NULL is not good :(

I will send a PR.

Linked PRs

Activity

  1. self-assigned this
    on Sep 10, 2024
  2. added a commit that references this issue on Sep 10, 2024
  3. sobolevn commented on Sep 10, 2024

    @sobolevn
    MemberAuthor

    Will be solved in #123910
    Closing as a duplicate.

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