From bd16d3f503ee1e34f1b2852f0bddd1cdb3529192 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Wed, 29 May 2024 10:21:06 +0200 Subject: [PATCH] fix: I2 --- src/handle_init_contract.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index e6d79b5..1ac485b 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -40,6 +40,13 @@ void handle_init_contract(ethPluginInitContract_t *msg) { } context->selectorIndex = index; + // check for overflow + if ((size_t) context->selectorIndex != index) { + PRINTF("Error: overflow detected on selector index!\n"); + msg->result = ETH_PLUGIN_RESULT_ERROR; + return; + } + msg->result = ETH_PLUGIN_RESULT_OK; switch (context->selectorIndex) {