All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 01/13] ALSA: seq: ump: Fix -Wformat-truncation warning
Date: Fri, 15 Sep 2023 10:27:50 +0200	[thread overview]
Message-ID: <20230915082802.28684-2-tiwai@suse.de> (raw)
In-Reply-To: <20230915082802.28684-1-tiwai@suse.de>

The filling of a port name string got a warning with W=1 due to the
potentially too long group name.  Add the string precision to limit
the size.

Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/core/seq/seq_ump_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/seq/seq_ump_client.c b/sound/core/seq/seq_ump_client.c
index a60e3f069a80..2db371d79930 100644
--- a/sound/core/seq/seq_ump_client.c
+++ b/sound/core/seq/seq_ump_client.c
@@ -207,7 +207,7 @@ static void fill_port_info(struct snd_seq_port_info *port,
 		SNDRV_SEQ_PORT_TYPE_PORT;
 	port->midi_channels = 16;
 	if (*group->name)
-		snprintf(port->name, sizeof(port->name), "Group %d (%s)",
+		snprintf(port->name, sizeof(port->name), "Group %d (%.53s)",
 			 group->group + 1, group->name);
 	else
 		sprintf(port->name, "Group %d", group->group + 1);
-- 
2.35.3


  reply	other threads:[~2023-09-15  8:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15  8:27 [PATCH 00/13] ALSA: Fix -Wformat-truncation warnings Takashi Iwai
2023-09-15  8:27 ` Takashi Iwai [this message]
2023-09-15  8:27 ` [PATCH 02/13] ALSA: seq: midi: Fix -Wformat-truncation warning Takashi Iwai
2023-09-15  8:27 ` [PATCH 03/13] ALSA: usb-audio: scarlett_gen2: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 04/13] ALSA: caiaq: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 05/13] ALSA: sscape: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 06/13] ALSA: cs4236: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 07/13] ALSA: es1688: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 08/13] ALSA: opti9x: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 09/13] ALSA: xen: " Takashi Iwai
2023-09-15  8:27 ` [PATCH 10/13] ALSA: firewire: Fix -Wformat-truncation warning for longname string Takashi Iwai
2023-09-15 10:13   ` Takashi Sakamoto
2023-09-15  8:28 ` [PATCH 11/13] ALSA: firewire: Fix -Wformat-truncation warning for MIDI stream names Takashi Iwai
2023-09-15 10:14   ` Takashi Sakamoto
2023-09-15  8:28 ` [PATCH 12/13] ALSA: cmipci: Fix -Wformat-truncation warning Takashi Iwai
2023-09-15  8:28 ` [PATCH 13/13] ALSA: hda: generic: Check potential mixer name string truncation Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230915082802.28684-2-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.