From: Takashi Iwai Subject: Re: [alsa-devel] sound: bebop: strncmp length oddity Date: Thu, 17 Nov 2016 12:47:11 +0100 Message-ID: References: <1477777020.23018.8.camel@perches.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1477777020.23018.8.camel@perches.com> Sender: linux-kernel-owner@vger.kernel.org To: Joe Perches Cc: Takashi Sakamoto , alsa-devel , Clemens Ladisch , Takashi Iwai , LKML List-Id: alsa-devel@alsa-project.org 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