Fix dangerous intarray function#602
Merged
AndersAstrand merged 2 commits intopercona:mainfrom Jan 12, 2026
Merged
Conversation
This was just an unsafe alias for a function.
Instead of using unsafe libc functions (strcat) and cropping the integers (givin snprintf a buffer too small for any integer) we use postgres StringInfo as god intended.
1c6490b to
e3121b8
Compare
Contributor
Author
|
We can of course keep using a buffer in the stack if we really think this is performance critical. It would be simple to do. I think |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
- Coverage 85.61% 85.32% -0.30%
==========================================
Files 3 3
Lines 1342 1342
Branches 215 215
==========================================
- Hits 1149 1145 -4
- Misses 91 93 +2
- Partials 102 104 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jeltz
approved these changes
Jan 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#592 got me looking at this function and it had some weirdness to it.
This is a better version of the function I think, but maybe the
pfree()is unnecessary?