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 | |
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')
-rw-r--r-- | tests/tst-pam_end.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_fail_delay.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_get_item.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_getenvlist.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_set_data.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_set_item.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_start.c | 2 | ||||
-rw-r--r-- | tests/tst-pam_start_confdir.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/tests/tst-pam_end.c b/tests/tst-pam_end.c index 93c2fc32..d79df7c6 100644 --- a/tests/tst-pam_end.c +++ b/tests/tst-pam_end.c @@ -46,7 +46,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; diff --git a/tests/tst-pam_fail_delay.c b/tests/tst-pam_fail_delay.c index c4323178..d81c5765 100644 --- a/tests/tst-pam_fail_delay.c +++ b/tests/tst-pam_fail_delay.c @@ -46,7 +46,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; 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; diff --git a/tests/tst-pam_getenvlist.c b/tests/tst-pam_getenvlist.c index d24a9bf9..a1184f1a 100644 --- a/tests/tst-pam_getenvlist.c +++ b/tests/tst-pam_getenvlist.c @@ -48,7 +48,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; char **ptr; diff --git a/tests/tst-pam_set_data.c b/tests/tst-pam_set_data.c index 9acab6a6..d1eaa3ea 100644 --- a/tests/tst-pam_set_data.c +++ b/tests/tst-pam_set_data.c @@ -275,7 +275,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; void *dataptr; int retval; diff --git a/tests/tst-pam_set_item.c b/tests/tst-pam_set_item.c index bd17e11a..3457b49c 100644 --- a/tests/tst-pam_set_item.c +++ b/tests/tst-pam_set_item.c @@ -67,7 +67,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; diff --git a/tests/tst-pam_start.c b/tests/tst-pam_start.c index ce013633..8fa18f74 100644 --- a/tests/tst-pam_start.c +++ b/tests/tst-pam_start.c @@ -46,7 +46,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; 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; |