Skip to content

BUG: Avoid undefined behavior in array.astype()#24038

Merged
charris merged 2 commits intonumpy:maintenance/1.25.xfrom
charris:backport-24030
Jun 24, 2023
Merged

BUG: Avoid undefined behavior in array.astype()#24038
charris merged 2 commits intonumpy:maintenance/1.25.xfrom
charris:backport-24030

Conversation

@charris
Copy link
Member

@charris charris commented Jun 24, 2023

Backport of #24030.

If we don't initialize dt_info then the Py_XDECREF in the error path below tries to interpret garbage as a PyObject, leading to undefined behavior.

Fixes one of the issues pointed out in #24023.

@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Jun 24, 2023
@charris charris added this to the 1.25.1 release milestone Jun 24, 2023
@charris charris merged commit 4435420 into numpy:maintenance/1.25.x Jun 24, 2023
@charris charris deleted the backport-24030 branch June 24, 2023 22:12
@charris
Copy link
Member Author

charris commented Jun 24, 2023

The test failure is unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants