55a01cab83
When _FORTIFY_SOURCE=2, glibc version is 2.35, and GCC version is 12.1.0, the compiler complains as follows: In file included from /usr/include/string.h:535, from /home/alarm/q/var/qemu/include/qemu/osdep.h:99, from ../crypto/block-luks.c:21: In function 'memset', inlined from 'qcrypto_block_luks_store_key' at ../crypto/block-luks.c:843:9: /usr/include/bits/string_fortified.h:59:10: error: 'splitkeylen' may be used uninitialized [-Werror=maybe-uninitialized] 59 | return __builtin___memset_chk (__dest, __ch, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | __glibc_objsize0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ../crypto/block-luks.c: In function 'qcrypto_block_luks_store_key': ../crypto/block-luks.c:699:12: note: 'splitkeylen' was declared here 699 | size_t splitkeylen; | ^~~~~~~~~~~ It seems the compiler cannot see that splitkeylen will not be used when splitkey is NULL. Suppress the warning by initializing splitkeylen even when splitkey stays NULL. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> |
||
---|---|---|
.. | ||
aes.c | ||
afalg.c | ||
afalgpriv.h | ||
afsplit.c | ||
akcipher-gcrypt.c.inc | ||
akcipher-nettle.c.inc | ||
akcipher.c | ||
akcipherpriv.h | ||
block-luks-priv.h | ||
block-luks.c | ||
block-luks.h | ||
block-qcow.c | ||
block-qcow.h | ||
block.c | ||
blockpriv.h | ||
cipher-afalg.c | ||
cipher-builtin.c.inc | ||
cipher-gcrypt.c.inc | ||
cipher-gnutls.c.inc | ||
cipher-nettle.c.inc | ||
cipher.c | ||
cipherpriv.h | ||
der.c | ||
der.h | ||
hash-afalg.c | ||
hash-gcrypt.c | ||
hash-glib.c | ||
hash-gnutls.c | ||
hash-nettle.c | ||
hash.c | ||
hashpriv.h | ||
hmac-gcrypt.c | ||
hmac-glib.c | ||
hmac-gnutls.c | ||
hmac-nettle.c | ||
hmac.c | ||
hmacpriv.h | ||
init.c | ||
ivgen-essiv.c | ||
ivgen-essiv.h | ||
ivgen-plain64.c | ||
ivgen-plain64.h | ||
ivgen-plain.c | ||
ivgen-plain.h | ||
ivgen.c | ||
ivgenpriv.h | ||
meson.build | ||
pbkdf-gcrypt.c | ||
pbkdf-gnutls.c | ||
pbkdf-nettle.c | ||
pbkdf-stub.c | ||
pbkdf.c | ||
random-gcrypt.c | ||
random-gnutls.c | ||
random-none.c | ||
random-platform.c | ||
rsakey-builtin.c.inc | ||
rsakey-nettle.c.inc | ||
rsakey.c | ||
rsakey.h | ||
secret_common.c | ||
secret_keyring.c | ||
secret.c | ||
sm4.c | ||
tls-cipher-suites.c | ||
tlscreds.c | ||
tlscredsanon.c | ||
tlscredspriv.h | ||
tlscredspsk.c | ||
tlscredsx509.c | ||
tlssession.c | ||
trace-events | ||
trace.h | ||
xts.c |