Return error on invalid hex for io::Read on HexToBytesIter#178
Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom Jun 23, 2025
Merged
Return error on invalid hex for io::Read on HexToBytesIter#178apoelstra merged 1 commit intorust-bitcoin:masterfrom
apoelstra merged 1 commit intorust-bitcoin:masterfrom
Conversation
Member
|
Should backport to the 1.x branch. (You don't have to do this @stevenroose; @tcharding or I can do it.) |
Member
|
On this branch we probably want to release a 0.3.1 to get the bugfix out. |
tcharding
approved these changes
Jun 23, 2025
Member
|
Backported in #182 |
Author
|
I understand you guys will merge and do 0.2.x and 0.3.x releases? |
Member
|
@stevenroose no, we will do a 0.3.x release and a 1.0-rc.2 release. |
apoelstra
added a commit
that referenced
this pull request
Jun 23, 2025
…ToBytesIter 102a77e Return error on invalid hex for io::Read on HexToBytesIter (Steven Roose) Pull request description: Backport the bugfix in #178 Currently this test passes, and it should not. ```rust fn main() { let good_hex = "deadbeef00deadbeef"; let bad_hex = "deadbeefXX00XXdeadbeef"; let mut buf = vec![]; let mut iter = HexToBytesIter::new(good_hex).unwrap(); iter.read_to_end(&mut buf).unwrap(); assert_eq!(buf.as_hex().to_string(), good_hex); let mut buf = vec![]; let mut iter = HexToBytesIter::new(bad_hex).unwrap(); iter.read_to_end(&mut buf).unwrap(); assert_eq!(buf.as_hex().to_string(), good_hex); } ``` Created using: git cherry-pick b67244c ACKs for top commit: apoelstra: ACK 102a77e; successfully ran local tests Tree-SHA512: 605c29bb2dbca90b41a2eaabe814464521bbbdee4ebc116b9260163252a084426f886c50ba601c184e8ed4bdc0fad21a07eb31a99445d693853abd7fee659761
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.
Fixes #177