AntelopeIO / abieos

Other
2 stars 12 forks source link

abieos_bin_to_json fails on trailing zeros #12

Closed cc32d9 closed 1 year ago

cc32d9 commented 1 year ago

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.

heifner commented 1 year ago

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

cc32d9 commented 1 year ago

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

https://github.com/AntelopeIO/abieos/blob/06fac058514378aa491056f8613d4c739ff89fdb/src/abieos.cpp#L243

cc32d9 commented 1 year ago

Proposed fix: https://github.com/cc32d9/abieos/commit/e747595f9f458db29c76a6115e3f6b78b60d241b