Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5548 from twinstar26/master
Browse files Browse the repository at this point in the history
Fix rlp tool failing to parse long hex string
  • Loading branch information
chfast authored Apr 10, 2019
2 parents bcb960e + 071dbfe commit 81827d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
- Fixed: [#5523](https://github.com/ethereum/aleth/pull/5523) [#5533](https://github.com/ethereum/aleth/pull/5533) Fix syncing terminating prematurely because of race condition.
- Fixed: [#5539](https://github.com/ethereum/aleth/pull/5539) Fix logic for determining if dao hard fork block header should be requested.
- Fixed: [#5547](https://github.com/ethereum/aleth/pull/5547) Fix unnecessary slow-down of eth_flush RPC method.
- Fixed: [#5548](https://github.com/ethereum/aleth/pull/5548) Fix rlp tool for long hexadecimal string inputs.

[1.6.0]: https://github.com/ethereum/aleth/compare/v1.6.0-alpha.1...release/1.6
[1.6.0]: https://github.com/ethereum/aleth/compare/v1.6.0-alpha.1...release/1.6
17 changes: 14 additions & 3 deletions rlp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <libethcore/Common.h>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/system/error_code.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/options_description.hpp>
#include <clocale>
Expand Down Expand Up @@ -259,10 +260,20 @@ int main(int argc, char** argv)
if (inputFile == "--")
for (int i = cin.get(); i != -1; i = cin.get())
in.push_back((byte)i);
else if (boost::filesystem::is_regular_file(inputFile))
in = contents(inputFile);
else
in = asBytes(inputFile);
{
try
{
if (boost::filesystem::is_regular_file(inputFile))
in = contents(inputFile);
}
catch (boost::filesystem::filesystem_error const&)
{
}

if (in.empty())
in = asBytes(inputFile);
}

bytes b;

Expand Down

0 comments on commit 81827d2

Please sign in to comment.