Skip to content

BUG: fix heap buffer overflow in timedelta to string casts#31206

Merged
charris merged 1 commit into
numpy:maintenance/2.4.xfrom
charris:backport-31110
Apr 10, 2026
Merged

BUG: fix heap buffer overflow in timedelta to string casts#31206
charris merged 1 commit into
numpy:maintenance/2.4.xfrom
charris:backport-31110

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Apr 10, 2026

Backport of 31110.

PR summary

Fixes #31109.

The resolve_descriptors implementation doesn't account for cases where the output string isn't large enough to hold the entire converted string.

The fix is to clamp the output dtype size to the input dtype size, if there's an explicit size.

AI Disclosure

No AI used.

@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Apr 10, 2026
@charris charris added this to the 2.4.5 release milestone Apr 10, 2026
@charris charris merged commit 88c3f2e into numpy:maintenance/2.4.x Apr 10, 2026
74 checks passed
@charris charris deleted the backport-31110 branch April 10, 2026 23:56
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