8000 `cursesmodule` uses `winobj` which might be `NULL` · Issue #123913 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
cursesmodule uses winobj which might be NULL #123913
Closed as not planned
Closed as not planned
@sobolevn

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

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

    0