Use strlcpy instead of strncpy
This commit is contained in:
@@ -10,7 +10,7 @@ bool copy_transaction_parameters(create_transaction_parameters_t* sign_transacti
|
||||
// We need this "trick" as the input data position can overlap with app-ethereum globals
|
||||
txStringProperties_t stack_data;
|
||||
memset(&stack_data, 0, sizeof(stack_data));
|
||||
strncpy(stack_data.fullAddress,
|
||||
strlcpy(stack_data.fullAddress,
|
||||
sign_transaction_params->destination_address,
|
||||
sizeof(stack_data.fullAddress));
|
||||
if ((stack_data.fullAddress[sizeof(stack_data.fullAddress) - 1] != '\0') ||
|
||||
|
||||
@@ -93,7 +93,7 @@ bool uint256_to_decimal(const uint8_t *value, size_t value_len, char *out, size_
|
||||
// Not enough space to hold "0" and \0.
|
||||
return false;
|
||||
}
|
||||
strncpy(out, "0", out_len);
|
||||
strlcpy(out, "0", out_len);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user