diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2021-06-13 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2021-06-13 08:00:00 +0000 |
commit | 4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212 (patch) | |
tree | 253b4bc4ddc4a502fb39cf88fbdf233c659a9293 /tests/tst-pam_start_confdir.c | |
parent | 980d90c9232fe5325d1a4deddd42c597cf9e1a54 (diff) | |
download | pam-4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212.tar.gz pam-4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212.tar.bz2 pam-4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212.zip |
tests: fix -Wmaybe-uninitialized warnings
Fix the following class of compilation warnings reported by gcc 11:
tst-pam_end.c: In function ‘main’:
tst-pam_end.c:55:12: error: ‘conv’ may be used uninitialized [-Werror=maybe-uninitialized]
55 | retval = pam_start (service, user, &conv, &pamh);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tst-pam_end.c:41:
../libpam/include/security/pam_appl.h:23:1: note: by argument 3 of type ‘const struct pam_conv *’ to ‘pam_start’ declared here
23 | pam_start(const char *service_name, const char *user,
| ^~~~~~~~~
tst-pam_end.c:49:19: note: ‘conv’ declared here
49 | struct pam_conv conv;
| ^~~~
* tests/tst-pam_end.c (main): Initialize conv variable.
* tests/tst-pam_fail_delay.c: Likewise.
* tests/tst-pam_get_item.c: Likewise.
* tests/tst-pam_getenvlist.c: Likewise.
* tests/tst-pam_set_data.c: Likewise.
* tests/tst-pam_set_item.c: Likewise.
* tests/tst-pam_start.c: Likewise.
* tests/tst-pam_start_confdir.c: Likewise.
Diffstat (limited to 'tests/tst-pam_start_confdir.c')
-rw-r--r-- | tests/tst-pam_start_confdir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tst-pam_start_confdir.c b/tests/tst-pam_start_confdir.c index e40b6e70..f731b2a5 100644 --- a/tests/tst-pam_start_confdir.c +++ b/tests/tst-pam_start_confdir.c @@ -50,7 +50,7 @@ main (void) const char *user = "root"; const char *confdir; const char *xconfdir = "/nonexistent-confdir"; - struct pam_conv conv; + struct pam_conv conv = { NULL, NULL }; pam_handle_t *pamh; int retval; |