Skip to content

Conversation

@jsquyres
Copy link
Member

Thanks to @Finder16 for reporting these off-by-one and underflow errors.

Thanks to @Finder16 for reporting these off-by-one and underflow
errors.

Signed-off-by: Jeff Squyres <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes two critical bugs in the opal_vsnprintf function: an off-by-one error that caused out-of-bounds memory access when writing the null terminator, and an underflow issue when the buffer size is zero.

  • Fixed off-by-one error in null terminator placement from str[size] to str[size - 1]
  • Added size > 0 check to prevent underflow when calculating size - 1 with unsigned size_t

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rhc54 added a commit to rhc54/openpmix that referenced this pull request Dec 24, 2025
rhc54 added a commit to openpmix/openpmix that referenced this pull request Dec 24, 2025
rhc54 added a commit to rhc54/openpmix that referenced this pull request Dec 30, 2025
Port of open-mpi/ompi#13592

Signed-off-by: Ralph Castain <[email protected]>
(cherry picked from commit 78af01e)
rhc54 added a commit to openpmix/openpmix that referenced this pull request Dec 30, 2025
Port of open-mpi/ompi#13592

Signed-off-by: Ralph Castain <[email protected]>
(cherry picked from commit 78af01e)
rhc54 added a commit to rhc54/openpmix that referenced this pull request Jan 7, 2026
Port of open-mpi/ompi#13592

Signed-off-by: Ralph Castain <[email protected]>
(cherry picked from commit 78af01e)
@hppritcha hppritcha self-requested a review January 10, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants