vanitygen: fix integer overflow

pull/17/head
Oliver Gugger 3 years ago
parent afdfbfbb02
commit 1c54e75705
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -73,6 +73,10 @@ func (c *vanityGenCommand) Execute(_ *cobra.Command, _ []string) error {
if len(prefixBytes) < 2 {
return fmt.Errorf("prefix must be at least 2 bytes")
}
if len(prefixBytes) > 8 {
return fmt.Errorf("prefix too long, unlikely to find a key " +
"within billions of years")
}
if !(prefixBytes[0] == 0x02 || prefixBytes[0] == 0x03) {
return fmt.Errorf("prefix must start with 02 or 03 because " +
"it's an EC public key")

Loading…
Cancel
Save