AntelopeIO/abieos

abieos_bin_to_json fails on trailing zeros

Closed this issue · 3 comments

seen in abieos as of July 5th 2022:

transfer action arguments have extra trailing zeros, like following:

90af61cc64aca479 000000000000ba4a 02b0d00300000000 06584d4400000000 00000000
90af61cc64aca479 000000000000ba4a 4e94d00300000000 06584d4400000000 00000000

instead of last 4 zero bytes, one (?) byte should indicate an empty memo, and the rest is garbage that should be ignored. But abieos_bin_to_json fails to decode this.

@cc32d9 tested with July 5th 2022 version. This may or may not have ever worked.

As @spoonincode mentioned, this line is producing the exact problem:

throw std::runtime_error("Extra data");

Proposed fix: cc32d9@e747595