Skip to content

Commit

Permalink
Merge pull request #30 from blooo-io/fix/04-04-24-security-2
Browse files Browse the repository at this point in the history
fix possible null pointer dereferences
  • Loading branch information
Z4karia authored Apr 8, 2024
2 parents 2fa3ad1 + f60f5d3 commit 31528f4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ static void set_send_value_ui(ethQueryContractUI_t *msg, plugin_parameters_t *co
return;
}

if (msg->pluginSharedRO == NULL) {
PRINTF("Error: msg->pluginSharedRO is NULL\n");
return;
}
if (msg->pluginSharedRO->txContent == NULL) {
PRINTF("Error: msg->pluginSharedRO->txContent is NULL\n");
return;
}

// Convert to string.
amountToString(msg->pluginSharedRO->txContent->value.value,
msg->pluginSharedRO->txContent->value.length,
Expand Down Expand Up @@ -311,6 +320,15 @@ static void set_smart_contract_ui(ethQueryContractUI_t *msg, plugin_parameters_t
return;
}

if (msg->pluginSharedRO == NULL) {
PRINTF("Error: msg->pluginSharedRO is NULL\n");
return;
}
if (msg->pluginSharedRO->txContent == NULL) {
PRINTF("Error: msg->pluginSharedRO->txContent is NULL\n");
return;
}

print_address(msg, msg->pluginSharedRO->txContent->destination);
}

Expand Down

0 comments on commit 31528f4

Please sign in to comment.