lkml.org 
[lkml]   [2012]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()
From
Date
On Jan 8, 2012, at 4:09 AM, Takashi Iwai wrote:
> As of now, I have little time to evaluate, so I might have missed
> something, but I wonder whether
>
> /* avoid overflow */
> if (nr_rates == KMALLOC_MAX_SIZE / sizeof(int))
> break;
>
> is the best way to check. This looks ugly to me.
> If we need to limit the number of rates, better to define some proper
> numbers as the upper limit. And then, it should warn, not only
> breaking loop.

Thanks for looking into this. Yeah, I agree using something like
MAX_NR_RATES is better. Is 65535 okay or do we need a larger limit?

- xi


\
 
 \ /
  Last update: 2012-01-08 13:47    [W:0.056 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site