From: Jakub Jelen <jjelen@redhat.com>
Date: Mon, 20 May 2024 21:31:38 +0200
Subject: pkcs15init: Avoid using uninitialized memory

Thanks Matteo Marini for report

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Origin: https://github.com/OpenSC/OpenSC/commit/bde991b0fe4f0250243b0e4960978b1043c13b03
Bug: https://github.com/OpenSC/OpenSC/security/advisories/GHSA-h5f7-rjr5-vx54
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2309285
Bug: https://github.com/OpenSC/OpenSC/wiki/CVE-2024-45615
Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2024-45615
Bug-Debian: https://bugs.debian.org/1082859
---
 src/pkcs15init/profile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pkcs15init/profile.c b/src/pkcs15init/profile.c
index 74fbdce..16c2ddf 100644
--- a/src/pkcs15init/profile.c
+++ b/src/pkcs15init/profile.c
@@ -1807,7 +1807,7 @@ do_pin_storedlength(struct state *cur, int argc, char **argv)
 static int
 do_pin_flags(struct state *cur, int argc, char **argv)
 {
-	unsigned int	flags;
+	unsigned int	flags = 0;
 	int		i, r;
 
 	if (cur->pin->pin.auth_type != SC_PKCS15_PIN_AUTH_TYPE_PIN)
