* [PATCH] ALSA: hdsp: enlarge the MIDI name buffer
@ 2026-11-14 13:02 Aibing Chen
2026-11-16 14:31 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Aibing Chen @ 2026-11-14 13:02 UTC (permalink / raw)
To: Takashi Iwai, Jaroslav Kysela; +Cc: linux-sound, linux-kernel
snd_hdsp_create_midi() formats "<card shortname> MIDI <n>" into a 40
byte buffer. The card shortname can be up to 31 characters, " MIDI "
adds 6 and the MIDI number up to 11, so the name can reach 48
characters plus the terminator.
Building with W=1 reports a -Wformat-truncation warning: the output can
reach 49 bytes including the terminator into a destination of size 40.
Only the rawmidi device name is affected, so nothing changes apart from
the name no longer being cut short.
Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
sound/pci/rme9652/hdsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 7dce548b9..ba5c8bf0f 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -1482,7 +1482,7 @@ static const struct snd_rawmidi_ops snd_hdsp_midi_input =
static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
{
- char buf[40];
+ char buf[64];
hdsp->midi[id].id = id;
hdsp->midi[id].rmidi = NULL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hdsp: enlarge the MIDI name buffer
2026-11-14 13:02 [PATCH] ALSA: hdsp: enlarge the MIDI name buffer Aibing Chen
@ 2026-11-16 14:31 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-11-16 14:31 UTC (permalink / raw)
To: Aibing Chen; +Cc: Takashi Iwai, Jaroslav Kysela, linux-sound, linux-kernel
On Sat, 14 Nov 2026 14:02:20 +0100,
Aibing Chen wrote:
>
> snd_hdsp_create_midi() formats "<card shortname> MIDI <n>" into a 40
> byte buffer. The card shortname can be up to 31 characters, " MIDI "
> adds 6 and the MIDI number up to 11, so the name can reach 48
> characters plus the terminator.
>
> Building with W=1 reports a -Wformat-truncation warning: the output can
> reach 49 bytes including the terminator into a destination of size 40.
> Only the rawmidi device name is affected, so nothing changes apart from
> the name no longer being cut short.
>
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
The real question is whether it really overflows and truncated with
the driver's actual setups. Otherwise it's nothing wrong in the code,
per se.
Could you verify that?
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-16 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 13:02 [PATCH] ALSA: hdsp: enlarge the MIDI name buffer Aibing Chen
2026-11-16 14:31 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox