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

Appearance settings

Handle errors correctly in tmtotuple in timemodule #118998

Copy link
Copy link
Closed
@sobolevn

Description

@sobolevn
Issue body actions

Bug report

This call is problematic:

#define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val))

It can return NULL in theory.

These calls also can return NULL:

This error guard in the end will only show the last error:

if (PyErr_Occurred()) {
Py_XDECREF(v);
return NULL;
}
Not the first one. Also: why XDECREF when v cannot be NULL at this point?

Refs #116714

I will send a PR adding our regular macro for the job.

Linked PRs

Metadata

Metadata

Assignees

Labels

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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.