Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Aibing Chen <chenaibing@cmss.chinamobile.com>
Cc: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: hdsp: enlarge the MIDI name buffer
Date: Mon, 16 Nov 2026 15:31:26 +0100	[thread overview]
Message-ID: <87o6boyhj5.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261114130220.142-1-chenaibing@cmss.chinamobile.com>

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

      reply	other threads:[~2026-11-16 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 13:02 [PATCH] ALSA: hdsp: enlarge the MIDI name buffer Aibing Chen
2026-11-16 14:31 ` Takashi Iwai [this message]

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=87o6boyhj5.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chenaibing@cmss.chinamobile.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox