Fix all the defects identified by Clang Static Analyzer

Some fixes are dirty, but it is a start to enforce scan-build on
every commit.

Signed-off-by: pscott <scott.piriou@ledger.fr>
This commit is contained in:
Jean-Baptiste Bédrune
2021-07-16 12:04:39 +02:00
committed by pscott
parent c27d59d792
commit cd78581ffd
15 changed files with 158 additions and 144 deletions

View File

@@ -132,11 +132,13 @@ UX_FLOW(ux_settings_flow,
&ux_settings_flow_4_step);
void display_settings(const ux_flow_step_t* const start_step) {
strcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"));
strcpy(strings.common.fullAddress + 12,
(N_storage.contractDetails ? "Displayed" : "NOT Displayed"));
strcpy(strings.common.fullAddress + 26,
(N_storage.displayNonce ? "Displayed" : "NOT Displayed"));
strlcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"), 12);
strlcpy(strings.common.fullAddress + 12,
(N_storage.contractDetails ? "Displayed" : "NOT Displayed"),
26 - 12);
strlcpy(strings.common.fullAddress + 26,
(N_storage.displayNonce ? "Displayed" : "NOT Displayed"),
sizeof(strings.common.fullAddress) - 26);
ux_flow_init(0, ux_settings_flow, start_step);
}