lkml.org 
[lkml]   [2016]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] sound: bebop: strncmp length oddity
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

\
 
 \ /
  Last update: 2016-11-17 12:48    [W:0.161 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site