mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Joe Perches <joe@perches.com>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>,
	alsa-devel <alsa-devel@alsa-project.org>,
	Clemens Ladisch <clemens@ladisch.de>,
	Takashi Iwai <tiwai@suse.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] sound: bebop: strncmp length oddity
Date: Thu, 17 Nov 2016 12:47:11 +0100	[thread overview]
Message-ID: <s5hr36awcow.wl-tiwai@suse.de> (raw)
In-Reply-To: <1477777020.23018.8.camel@perches.com>

On Sat, 29 Oct 2016 23:37:00 +0200,
Joe Perches wrote:
> 
> 15 isn't the length of the string, is that really what's desired?
> 
> linux/next/sound/firewire/bebob/bebop.c
> 
> -----------------------------
> 
> static bool
> check_audiophile_booted(struct fw_unit *unit)
> {
> 	char name[24] = {0};
> 
> 	if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0)
> 		return false;
> 
> 	return strncmp(name, "FW Audiophile Bootloader", 15) != 0;
> }

Indeed it looks bogus.  Even "FW...." string is already 24 letters, so
it's over name[] array size.

Sakamoto-san, could you fix it properly?


thanks,

Takashi

  reply	other threads:[~2016-11-17 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29 21:37 Joe Perches
2016-11-17 11:47 ` Takashi Iwai [this message]
2016-11-17 20:07   ` Takashi Sakamoto
2016-11-17 21:34     ` Nicolas Iooss

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=s5hr36awcow.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o-takashi@sakamocchi.jp \
    --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

all inboxes | Powered by JetHome®