summaryrefslogtreecommitdiff
path: root/tests/tst-pam_get_item.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2021-06-13 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2021-06-13 08:00:00 +0000
commit4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212 (patch)
tree253b4bc4ddc4a502fb39cf88fbdf233c659a9293 /tests/tst-pam_get_item.c
parent980d90c9232fe5325d1a4deddd42c597cf9e1a54 (diff)
downloadlinux-pam-git-4dee3f8dcd9d1d57279d89fa3f67fcf4da7e0212.tar.gz
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_get_item.c')
-rw-r--r--tests/tst-pam_get_item.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tst-pam_get_item.c b/tests/tst-pam_get_item.c
index 2b0cc7e2..c6e3d9fa 100644
--- a/tests/tst-pam_get_item.c
+++ b/tests/tst-pam_get_item.c
@@ -66,7 +66,7 @@ main (void)
{
const char *service = "dummy";
const char *user = "root";
- struct pam_conv conv;
+ struct pam_conv conv = { NULL, NULL };
pam_handle_t *pamh;
int retval;
unsigned int i;