From: Takashi Iwai Subject: Re: [PATCH - asihpi 4/5] add extra checks to control cache Date: Tue, 29 Jul 2008 14:52:56 +0200 Message-ID: References: <1216360819-1847-1-git-send-email-linux@audioscience.com> <1216360819-1847-2-git-send-email-linux@audioscience.com> <1216360819-1847-3-git-send-email-linux@audioscience.com> <1216360819-1847-4-git-send-email-linux@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 2B75C1037F8 for ; Tue, 29 Jul 2008 14:52:57 +0200 (CEST) In-Reply-To: <1216360819-1847-4-git-send-email-linux@audioscience.com> 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: linux@audioscience.com Cc: Eliot Blennerhassett , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 18 Jul 2008 18:00:18 +1200, linux@audioscience.com wrote: > > @@ -486,14 +487,16 @@ short HpiCheckControlCache( > &aDesc[dwIndex].pData[dwOffset], 8); > nRemainingChars = > nStringLength - dwOffset - 8; > - if (nRemainingChars < 0) > + if (nRemainingChars < 0) { > nRemainingChars = 0; > + phr->u.cu.chars8.szData[8 + > + nRemainingChars] = 0; > + } This change looks incorrect. szData is 8-bytes array, and you reset nRemainigChars to 0. Also, not sure what this zero-clear actually does... Takashi