26c61c6
diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c
26c61c6
index 41e620a..57f8a79 100644
26c61c6
--- a/src/tools/opensc-explorer.c
26c61c6
+++ b/src/tools/opensc-explorer.c
26c61c6
@@ -1839,6 +1839,12 @@ static int do_apdu(int argc, char **argv)
26c61c6
 	if (argc < 1)
26c61c6
 		return usage(do_apdu);
26c61c6
 
26c61c6
+	/* gcc-11 complains about BUF potentially being used without being
26c61c6
+	   initialized.  I can't convince myself that the calls to
26c61c6
+	   parse_string_or_hexdata will fully initialize it, so we just
26c61c6
+	   initialize it here.  */
26c61c6
+	memset (buf, 0, sizeof (buf));
26c61c6
+
26c61c6
 	/* loop over the args and parse them, making sure the result fits into buf[] */
26c61c6
 	for (i = 0, len = 0; i < (unsigned) argc && len < sizeof(buf); i++)   {
26c61c6
 		size_t len0 = sizeof(buf) - len;