lkml.org 
[lkml]   [2015]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] ozwpan: Use proper check to prevent heap overflow
On Tue, May 26, 2015 at 02:17:46PM +0200, Jason A. Donenfeld wrote:
> + data_len = elt->length -
> sizeof(struct oz_get_desc_rsp) + 1;

This was in the original code, but I wonder where the + 1 comes from.
Does anyone know?

To be honest, I would prefer if we just checked:

if (elt->length < sizeof(struct oz_get_desc_rsp) + 1)
return;
data_len = elt->length - sizeof(struct oz_get_desc_rsp) + 1;

Shouldn't there be an upper bound on length? Shigekatsu?

regards,
dan carpenter


\
 
 \ /
  Last update: 2015-05-26 16:21    [W:0.072 / U:4.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site