Parent: 745f324de5898bb63878356bd6639ae6b7e2c3fe
Author: Bastien Nocera <hadess@hadess.net>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-05-16 23:36:08
Tree: b4250e34816ea4f404aa1ef9b663f5a984801ead
shared/ecc: Fix uninitialised variable usage Error: UNINIT (CWE-457): [#def41] [important] src/shared/ecc.c:869:2: var_decl: Declaring variable "pk" without initializer. src/shared/ecc.c:885:34: uninit_use_in_call: Using uninitialized element of array "pk.x" when calling "ecc_point_is_zero". 883| 884| ecc_point_mult(&pk, &curve_g, priv, NULL, vli_num_bits(priv)); 885|-> } while (ecc_point_is_zero(&pk)); 886| 887| ecc_native2bytes(priv, private_key); Error: UNINIT (CWE-457): [#def42] [important] src/shared/ecc.c:869:2: var_decl: Declaring variable "pk" without initializer. src/shared/ecc.c:885:34: uninit_use_in_call: Using uninitialized element of array "pk.x" when calling "ecc_point_is_zero". src/shared/ecc.c:885:34: uninit_use_in_call: Using uninitialized element of array "pk.y" when calling "ecc_point_is_zero". 883| 884| ecc_point_mult(&pk, &curve_g, priv, NULL, vli_num_bits(priv)); 885|-> } while (ecc_point_is_zero(&pk)); 886| 887| ecc_native2bytes(priv, private_key); Error: UNINIT (CWE-457): [#def43] [important] src/shared/ecc.c:869:2: var_decl: Declaring variable "pk" without initializer. src/shared/ecc.c:889:2: uninit_use_in_call: Using uninitialized value "*pk.y" when calling "ecc_native2bytes". 887| ecc_native2bytes(priv, private_key); 888| ecc_native2bytes(pk.x, public_key); 889|-> ecc_native2bytes(pk.y, &public_key[32]); 890| 891| return true;
Diffstat
| M | src/shared/ecc.c | | | 2 | ++ |
1 files changed, 2 insertions(+), 0 deletions(-)