Open fishilico opened 3 years ago
Thanks for opening this issue, this is indeed a bug!
Did you encounter this while attempting an operation with a Michelson address in binary format or were you inspecting code? The reason I ask - tezos-client
only prepares addresses as ASCII so we aren't aware of a real world instance where this code is used.
As we think about the best solution for this, if the code is dead in practice since only ASCII is used, the best solution could be to remove it and avoid the unnecessary feature (and the testing challenges that come from not being able to create binary formatted addresses from tezos-client).
Additional feedback on how you encountered this will help us make the right decision here. This will most likely be done as part of a batch of changes, whenever that may be. Thanks again!
Did you encounter this while attempting an operation with a Michelson address in binary format or were you inspecting code?
Thanks for your quick reply! I am working on a fuzzing+code coverage tool and wanted to test it on some Ledger Nano applications. I found this bug while investigating why some lines of code appeared to never be reached according to the code coverage report. So I do not know whether a real Tezos transaction runs the buggy code path.
Hello, While reading the state machine in
src/operations.c
I am wondering how this code works:More precisely after
case 0: ... state->address_step=1;
andcase 1: ... state->address_step=2;
, why is there nostate->address_step=3;
on line 209, at the end ofcase 2:
? The case block "falls through" intocase 3
and then the function returns inCALL_SUBPARSER
(line 212). When I add someprintf
statements in this function to analyze where the flow goes, it seems that the "subparsing" goes back to line 207 instead of line 212 and that the code in lines 213-215 is never executed. Did I understand the code correctly or did I miss something?
tz1dk5tsD3vr1ib7XY2CULdWa81vMBbVbjDj
Hello, While reading the state machine in
src/operations.c
I am wondering how this code works: https://github.com/obsidiansystems/ledger-app-tezos/blob/58797b2f9606c5a30dd1ccc9e5b9962e45e10356/src/operations.c#L199-L213More precisely after
case 0: ... state->address_step=1;
andcase 1: ... state->address_step=2;
, why is there nostate->address_step=3;
on line 209, at the end ofcase 2:
? The case block "falls through" intocase 3
and then the function returns inCALL_SUBPARSER
(line 212). When I add someprintf
statements in this function to analyze where the flow goes, it seems that the "subparsing" goes back to line 207 instead of line 212 and that the code in lines 213-215 is never executed. Did I understand the code correctly or did I miss something?