On Wed, Nov 30, 2011 at 12:57:27PM -0500, Xi Wang wrote:
> On Nov 30, 2011, at 10:15 AM, Dan Carpenter wrote:
> > It doesn't actually matter because sizeof(SBSSIDList) is just 4 but
> > normally you would do the math different.
> > 
> >             if (sList.uItem > ULONG_MAX / sizeof(SBSSIDItem) - 
> > sizeof(SBSSIDList)) {
> > 
> > But both checks are low enough in this case.
> 
> Just out of curiosity, why do you prefer this form here?
> 
> In general, for *alloc(a + x * b), the check
> 
>       x > (umax - a) / b
> 
> looks more correct to me.

Grr...  You're right again.  This is like basic algebra isn't it.  I
used to be ok at this in high school.

Sorry, for the noise.

regards,
dan carpenter

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to