DPP: Fix uninitialised variable on error path

The current code generates a warning when compiled by Clang, because if
we goto 'fail:', password_len can be uninitialised when we pass it in to
bin_clear_free().

Note that the actual usage is safe, because bin_clear_free() ignores
the second argument if the first argument is NULL, but it still seems
worth cleaning up.

Signed-off-by: Alasdair Mackintosh <alasdair at google.com>
This commit is contained in:
Alasdair Mackintosh 2022-03-09 13:24:49 -08:00 committed by Jouni Malinen
parent 3a157fe92f
commit ae512c30a1

View file

@ -2059,7 +2059,7 @@ struct wpabuf * dpp_build_csr(struct dpp_authentication *auth, const char *name)
struct wpabuf *priv_key;
u8 cp[DPP_CP_LEN];
char *password = NULL;
size_t password_len;
size_t password_len = 0;
int hash_sign_algo;
/* TODO: use auth->csrattrs */