Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Thenew_interpreter() function incorrectly returns_PyStatus_OK() on some error code paths #112729

Closed
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or error
@colesbury

Description

@colesbury

Bug report

The following code paths should probably returns some sort of exception status (possibly_PyStatus_NO_MEMORY()).

PyInterpreterState*interp=PyInterpreterState_New();
if (interp==NULL) {
*tstate_p=NULL;
return_PyStatus_OK();
}

PyThreadState*tstate=_PyThreadState_New(interp,
_PyThreadState_WHENCE_INTERP);
if (tstate==NULL) {
PyInterpreterState_Delete(interp);
*tstate_p=NULL;
return_PyStatus_OK();
}

Note thatPyInterpreterState_New() currently never returns NULL -- it callsPy_FatalError() instead -- but we should probably still handle that case as well.

_PyThreadState_New can return NULL when out of memory.

cc@ericsnowcurrently

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp