From: Daan De Meyer Date: Mon, 19 Feb 2024 15:55:42 +0000 (+0100) Subject: pkcs11-util: Explicitly initiaiize variable to avoid warning X-Git-Tag: v256-rc1~810 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b54fe8d6dc3a8479708f57a5bef1702c6c49cf2;p=thirdparty%2Fsystemd.git pkcs11-util: Explicitly initiaiize variable to avoid warning Avoid the following warning on C9S by explicitly initializing "object". """ [389/2801] Compiling C object src/shared/libsystemd-shared-256-devel.a.p/pkcs11-util.c.o ../src/src/shared/pkcs11-util.c: In function ‘pkcs11_token_find_private_key’: ../src/src/shared/pkcs11-util.c:983:21: warning: ‘object’ may be used uninitialized in this function [-Wmaybe-uninitialized] 983 | *ret_object = object; | ~~~~~~~~~~~~^~~~~~~~ """ --- diff --git a/src/shared/pkcs11-util.c b/src/shared/pkcs11-util.c index a172f646ca2..832d8af7e4b 100644 --- a/src/shared/pkcs11-util.c +++ b/src/shared/pkcs11-util.c @@ -873,7 +873,7 @@ int pkcs11_token_find_private_key( uint_fast8_t n_objects = 0; bool found_class = false; _cleanup_free_ CK_ATTRIBUTE *attributes_buffer = NULL; - CK_OBJECT_HANDLE object, candidate; + CK_OBJECT_HANDLE object = 0, candidate; static const CK_OBJECT_CLASS class = CKO_PRIVATE_KEY; CK_BBOOL decrypt_value, derive_value; CK_ATTRIBUTE optional_attributes[] = {