[PATCH 0/1] MR4667: bcrypt: Initialize variable in all cases (Coverity)
If both branches are false we would never initialize it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4667
From: Fabian Maurer <dark.shadow4(a)web.de> If both branches are false we would never initialize it. --- dlls/bcrypt/gnutls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c index 68f84a553d2..f84389d1f31 100644 --- a/dlls/bcrypt/gnutls.c +++ b/dlls/bcrypt/gnutls.c @@ -1587,7 +1587,7 @@ static NTSTATUS key_export_dh_public( struct key *key, UCHAR *buf, ULONG len, UL BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)buf; ULONG size = key->u.a.bitlen / 8; gnutls_dh_params_t params; - gnutls_datum_t p, g, y, x = {0}; + gnutls_datum_t p, g, y = {0}, x = {0}; UCHAR *dst; int ret = GNUTLS_E_INVALID_REQUEST; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4667
There should always be either a public key or a private key, or both. If both branches can be false that's the bug that should be fixed. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4667#note_55635
participants (3)
-
Fabian Maurer -
Fabian Maurer (@DarkShadow44) -
Hans Leidekker (@hans)