diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index d626713..2f428d3 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -297,11 +297,15 @@ static void handle_megaswap(ethPluginProvideParameter_t *msg, paraswap_parameter context->next_param = PATHS_LEN; break; case PATHS_LEN: - if (!U2BE_from_parameter(msg->parameter, &context->skip)) { - msg->result = ETH_PLUGIN_RESULT_ERROR; + { + uint16_t skip; + if (!U2BE_from_parameter(msg->parameter, &skip)) { + msg->result = ETH_PLUGIN_RESULT_ERROR; + } + context->skip = (uint8_t) skip; + context->skip--; // Decrease by one because we wish to acces path[-1]. + context->next_param = PATH; } - context->skip--; // Decrease by one because we wish to acces path[-1]. - context->next_param = PATH; break; case PATH: context->checkpoint = msg->parameterOffset;