[alsa-devel] [PATCH - asihpi 4/5] add extra checks to control cache

Takashi Iwai tiwai at suse.de
Tue Jul 29 14:52:56 CEST 2008


At Fri, 18 Jul 2008 18:00:18 +1200,
linux at 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


More information about the Alsa-devel mailing list