Also check library addresses.

This commit is contained in:
chriseth
2017-01-24 23:37:48 +01:00
parent 605455f96b
commit 3949624a61
4 changed files with 49 additions and 23 deletions
+5
View File
@@ -432,6 +432,11 @@ bool CommandLineInterface::parseLibraryOption(string const& _input)
string addrString(lib.begin() + colon + 1, lib.end());
boost::trim(libName);
boost::trim(addrString);
if (!passesAddressChecksum(addrString, false))
{
cerr << "Invalid checksum on library address \"" << libName << "\": " << addrString << endl;
return false;
}
bytes binAddr = fromHex(addrString);
h160 address(binAddr, h160::AlignRight);
if (binAddr.size() > 20 || address == h160())