]> git.proxmox.com Git - swtpm.git/commit
swtpm_setup: Initialize variables to avoid compiler warnings
authorStefan Berger <stefanb@linux.ibm.com>
Fri, 15 Oct 2021 11:44:53 +0000 (07:44 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 15 Oct 2021 12:44:14 +0000 (08:44 -0400)
commit8def57facd0999e94a9e8ffa22e8d46200e1e990
tree764f63a8ff074046175c03ddadc61abab51ba2a9
parent57b1f7ef88dc5c2995f105ea8f121d17765702ef
swtpm_setup: Initialize variables to avoid compiler warnings

Fix issue #591 by initializing the variables swtpm_has_tpm2 and
swtpm_has_tpm12.

swtpm_setup.c:1178:31: note: 'swtpm_has_tpm2' was declared here
     gboolean swtpm_has_tpm12, swtpm_has_tpm2;
                               ^~~~~~~~~~~~~~
swtpm_setup.c:1019:5: error: 'swtpm_has_tpm12' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     printf("{ \"type\": \"swtpm_setup\", "
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            "\"features\": [ %s%s\"cmdarg-keyfile-fd\", \"cmdarg-pwdfile-fd\", \"tpm12-not-need-root\""

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/swtpm_setup/swtpm_setup.c