mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
scripted-diff: Rename SetHex to SetHexDeprecated
SetHex is fragile, because it accepts any non-hex input or any length of input, without error feedback. This can lead to issues when the input is truncated or otherwise corrupted. Document the problem by renaming the method. In the future, the fragile method should be removed from the public interface. -BEGIN VERIFY SCRIPT- sed -i 's/SetHex/SetHexDeprecated/g' $( git grep -l SetHex ./src ) -END VERIFY SCRIPT-
This commit is contained in:
@@ -239,7 +239,7 @@ bool ParseHashStr(const std::string& strHex, uint256& result)
|
||||
if ((strHex.size() != 64) || !IsHex(strHex))
|
||||
return false;
|
||||
|
||||
result.SetHex(strHex);
|
||||
result.SetHexDeprecated(strHex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user