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

Fix rlp tool failing to parse long hex string #5548

Merged
merged 2 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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