From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH] ALSA: Warn when control names are truncated Date: Wed, 29 Oct 2008 14:33:16 +0000 Message-ID: <20081029143316.GA27763@rakim.wolfsonmicro.main> References: <1225289694-25584-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 9375124443 for ; Wed, 29 Oct 2008 15:33:17 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Wed, Oct 29, 2008 at 03:28:50PM +0100, Takashi Iwai wrote: > Mark Brown wrote: > > - if (ncontrol->name) > > + if (ncontrol->name) { > > + if (strlen(ncontrol->name) > sizeof(kctl.id.name)) > This should be '>=' since strlen() doesn't count the terminator. Oh, sorry - I'd misread strlcpy() as strncpy() (which would mean that the termination character wasn't needed).