lkml.org 
[lkml]   [2011]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [slabinfo PATCH] Fix off-by-one after readlink() call
On Fri, 14 Oct 2011, Thomas Jarosch wrote:

> The problem is the line after the readlink() call:
>
> buffer[count] = '\0';
>
> The common technique is to reduce the buffer size by one.
> Another fix would be to check
>
> "
> if (count < 0 || count == sizeof(buffer))
> fatal();
> "
>
> Reducing the buffer size by one is easier IMHO.
>

I think this should be used for changelog.

Acked-by: David Rientjes <rientjes@google.com>


\
 
 \ /
  Last update: 2011-10-14 21:55    [W:0.064 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site