lkml.org 
[lkml]   [2009]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] wusb: Use sizeof struct rather than pointer
Andrew Morton wrote:
>
> But I wonder if the code will still work. Because we then go on to do
>
> secd_size = le16_to_cpu(secd->wTotalLength);
> secd = krealloc(secd, secd_size, GFP_KERNEL);
>
> which implies (to me) that the thing we read from the device might
> indeed have been smaller than we expected, in which case the
> newly-fixed check will cause a failure.

We first read the security descriptor which tells use the total length
of the security descriptor plus all the following encryption type
descriptors. Your revised patch is fine.

David


\
 
 \ /
  Last update: 2009-11-24 03:27    [W:0.065 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site