GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BUG: Fix buffer overrun in CPU baseline validation by stratakis · Pull Request #30877 · numpy/numpy

Conversation

@stratakis

@stratakis stratakis commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Use sizeof() - 1 to exclude the string literal's null terminator when copying feature names into baseline_failure, preventing a buffer overrun and embedded nulls that truncated the error message.

Uncovered by Coverity static analysis

Fixes: #30477

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the 00 - Bug label Feb 25, 2026
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Feb 25, 2026
@seberg

seberg commented Feb 25, 2026

Copy link
Copy Markdown
Member

Thanks, but isn't the *fptr = 0 still wrong, i.e. the if condition should be changed to fptr > buffer and that branch already has the right write?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis
BUG: Fix buffer overrun in CPU baseline validation
d6a8053
Use sizeof() - 1 to exclude the string literal's null terminator when
copying feature names into baseline_failure, preventing a buffer
overrun and embedded nulls that truncated the error message.

Uncovered by Coverity static analysis
@stratakis
stratakis force-pushed the buffer_ovrfl branch from 67e1fa6 to d6a8053 Compare February 25, 2026 14:46
@stratakis

stratakis commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, but isn't the *fptr = 0 still wrong, i.e. the if condition should be changed to fptr > buffer and that branch already has the right write?

Right. Rebased.

seberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seberg
MAINT: Fix (somewhat spurious) MSVC return value warning.
ef42d50
seberg
seberg approved these changes Feb 26, 2026
View reviewed changes

@seberg seberg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, should go in once tests pass. Out of lazyness, I just pushed a fix here for that new warning in MSVC, no idea why it started showing up now.

From what I can tell briefly, there is on nice way to test this so...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@seberg
seberg merged commit 089ceb7 into numpy:main Feb 26, 2026
76 checks passed

Uh oh!

There was an error while loading. Please reload this page.

charris pushed a commit to charris/numpy that referenced this pull request Mar 4, 2026
@stratakis @seberg @charris
BUG: Fix buffer overrun in CPU baseline validation (numpy#30877)
057921f
Co-authored-by: Sebastian Berg <[email protected]>
@charris charris mentioned this pull request Mar 4, 2026
BUG: Fix buffer overrun in CPU baseline validation (#30877) #30922
Merged
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 4, 2026
charris added a commit that referenced this pull request Mar 4, 2026
@charris
Merge pull request #30922 from charris/backport-30877
62df6a5
BUG: Fix buffer overrun in CPU baseline validation (#30877)
sabasiddique1 pushed a commit to sabasiddique1/numpy that referenced this pull request Mar 4, 2026
@stratakis @seberg @sabasiddique1
BUG: Fix buffer overrun in CPU baseline validation (numpy#30877)
7c9b121
Co-authored-by: Sebastian Berg <[email protected]>
@doronbehar doronbehar mentioned this pull request Mar 9, 2026
python3Packages.numpy: SIGILL without SSE4.2 NixOS/nixpkgs#496822
Open
3 tasks done
@stratakis
stratakis deleted the buffer_ovrfl branch March 20, 2026 05:05
@stratakis stratakis mentioned this pull request Jul 8, 2026
BUG: fix CPU feature env diagnostic buffer overruns #31905
Merged
@charris charris mentioned this pull request Jul 10, 2026
BUG: fix CPU feature env diagnostic buffer overruns (#31905) #31953
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@seberg seberg seberg approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

00 - Bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BUG: Buffer overflow in npy__cpu_validate_baseline when CPU lacks baseline features

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stratakis @seberg @charris
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.