FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Zellic Audit] Fix Pushing Data by just-erray · Pull Request #14 · BitVM/rust-bitcoin-script · GitHub

[Zellic Audit] Fix Pushing Data - #14

Merged
RobinLinus merged 3 commits into
BitVM:mainfrom
just-erray:fix-single-element
Oct 10, 2025
Merged

[Zellic Audit] Fix Pushing Data #14
RobinLinus merged 3 commits into
BitVM:mainfrom
just-erray:fix-single-element

Conversation

Copy link
Copy Markdown
Contributor

This PR fixes a bug that causes an unexpected behaviour while pushing Vec<u8> or bitcoin::Witness to the stack. If a single length Vec<u8> was pushed to the stack [x], satisfying 128 <= x < 256, it was being interpreted as pushing [x, 0], causing both numbers pushed through Witness and single length vectors to act unexpectedly.

sander2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. Just one note: this does make pushing [x] where 1 <= x <= 16 less efficient - one byte can be saved by doing the optimization that push_int was doing

Copy link
Copy Markdown
Contributor Author

While applying @sander2's suggestion, I also realized that pushing [x] satisfying 128 < x < 256 with push_slice resulted in an invalid instruction, so I've split the single element case into 3 parts. This should now both be optimized and functioning properly.

Comment thread src/builder.rs Outdated
RobinLinus merged commit 01b4cb6 into BitVM:main Oct 10, 2025
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL