-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle invalid hex encoding in ParseHex
Summary: Seems a bit confusing to happily accept random bytes and pretend they are hex encoded strings Added a new TryParseHex function returning an optional. The old function remains an alias, with the fallback to an empty vector. This avoid having to change all existing code and making it needlessly verbose, because it is already properly handling empty vectors. This is a backport of [[bitcoin/bitcoin#25227 | core#25227]] Fix a hex string in checkpoints_tests that was obviously wrong (odd number of hex chars) and now causes ParseHex to return an empty vector. Depends on D17157 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, roqqit Reviewed By: roqqit Differential Revision: https://reviews.bitcoinabc.org/D17158
- Loading branch information
Showing
4 changed files
with
55 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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