Skip to content

Conversation

@rdmark
Copy link
Collaborator

@rdmark rdmark commented Aug 11, 2025

First, add a third data length check akin to what was done in #9

Second, explicitly return after test abort (primarily to signal to SonarQube that the test exits at that point)

rdmark added 2 commits August 11, 2025 20:33
bformata() and bassignformat() have calls to vsnprintf() that can
potentially overflow the buffer if the value of the second parameter
is extremely large

This adds some validation that bails out if the value reaches INT_MAX

The same fix was applied elsewhere in this file
The check library does a longjmp after an abort so this return statement
isn't actually ever reached, but adding this safeguard to protect against
potential library bugs, and to make it explicit for static analysis
that execution exists after an abort
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@rdmark rdmark marked this pull request as ready for review August 11, 2025 19:41
@rdmark rdmark requested a review from msteinert August 11, 2025 19:41
@msteinert msteinert merged commit 844a617 into main Aug 11, 2025
12 of 13 checks passed
@rdmark rdmark deleted the more-buffer-overflow branch August 12, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants