diff --git a/src_plugin_sdk/CHANGELOG.md b/src_plugin_sdk/CHANGELOG.md index f0bbbe9..a1c0f99 100644 --- a/src_plugin_sdk/CHANGELOG.md +++ b/src_plugin_sdk/CHANGELOG.md @@ -5,11 +5,13 @@ | :rotating_light: | Breaks build | | :warning: | Breaks compatibility with app | -## [latest](/) - 2023/12/06 +## [latest](/) - 2023/12/07 ### Fixed * standard\_plugin build ([this PR on the SDK](https://github.com/LedgerHQ/ledger-secure-sdk/pull/473) had broken it) +* Broken variant auto-setting in the standard\_plugin Makefile +* Missing null-check on parameters received by the plugins ### Changed diff --git a/src_plugin_sdk/main.c b/src_plugin_sdk/main.c index f06a2bb..b36171f 100644 --- a/src_plugin_sdk/main.c +++ b/src_plugin_sdk/main.c @@ -53,28 +53,32 @@ static void call_app_ethereum() { // Function to dispatch calls from the ethereum app. static void dispatch_call(int message, void *parameters) { - switch (message) { - case ETH_PLUGIN_INIT_CONTRACT: - handle_init_contract(parameters); - break; - case ETH_PLUGIN_PROVIDE_PARAMETER: - handle_provide_parameter(parameters); - break; - case ETH_PLUGIN_FINALIZE: - handle_finalize(parameters); - break; - case ETH_PLUGIN_PROVIDE_INFO: - handle_provide_token(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_ID: - handle_query_contract_id(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_UI: - handle_query_contract_ui(parameters); - break; - default: - PRINTF("Unhandled message %d\n", message); - break; + if (parameters != NULL) { + switch (message) { + case ETH_PLUGIN_INIT_CONTRACT: + handle_init_contract(parameters); + break; + case ETH_PLUGIN_PROVIDE_PARAMETER: + handle_provide_parameter(parameters); + break; + case ETH_PLUGIN_FINALIZE: + handle_finalize(parameters); + break; + case ETH_PLUGIN_PROVIDE_INFO: + handle_provide_token(parameters); + break; + case ETH_PLUGIN_QUERY_CONTRACT_ID: + handle_query_contract_id(parameters); + break; + case ETH_PLUGIN_QUERY_CONTRACT_UI: + handle_query_contract_ui(parameters); + break; + default: + PRINTF("Unhandled message %d\n", message); + break; + } + } else { + PRINTF("Received null parameters\n"); } } diff --git a/src_plugin_sdk/standard_plugin.mk b/src_plugin_sdk/standard_plugin.mk index 0fd12d1..5409d29 100644 --- a/src_plugin_sdk/standard_plugin.mk +++ b/src_plugin_sdk/standard_plugin.mk @@ -48,7 +48,7 @@ CURVE_APP_LOAD_PARAMS = secp256k1 PATH_APP_LOAD_PARAMS ?= "44'/60'" VARIANT_PARAM = COIN -VARIANTS_VALUES ?= $(NORMAL_NAME) +VARIANT_VALUES ?= $(NORMAL_NAME) HAVE_APPLICATION_FLAG_LIBRARY = 1