Fix edge-case memory bug in StringTable #1430

Open
Fri3dNstuff wants to merge 1 commit from Fri3dNstuff/string-table into main
Fri3dNstuff commented 2025-10-03 08:52:16 +00:00 (Migrated from github.com)

A failure to append to a StringTable's string_bytes would cause the table to be in an invalid state, with later calls to index or indexOrPut potentially reading uninitialised memory. The bug is now fixed.

A cleanup of the whole file might be worth doing, it is currently unnecessarily complicated; if that's wanted, I'll gladly do so.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
A failure to append to a `StringTable`'s `string_bytes` would cause the table to be in an invalid state, with later calls to `index` or `indexOrPut` potentially reading uninitialised memory. The bug is now fixed. A cleanup of the whole file might be worth doing, it is currently unnecessarily complicated; if that's wanted, I'll gladly do so. - [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Fri3dNstuff/string-table:Fri3dNstuff/string-table
git switch Fri3dNstuff/string-table

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff Fri3dNstuff/string-table
git switch Fri3dNstuff/string-table
git rebase main
git switch main
git merge --ff-only Fri3dNstuff/string-table
git switch Fri3dNstuff/string-table
git rebase main
git switch main
git merge --no-ff Fri3dNstuff/string-table
git switch main
git merge --squash Fri3dNstuff/string-table
git switch main
git merge --ff-only Fri3dNstuff/string-table
git switch main
git merge Fri3dNstuff/string-table
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!1430
No description provided.