lkml.org 
[lkml]   [2011]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/16] fix default __strnlen_user macro
Hi!

> The existing __strnlen_user macro simply resolved to strnlen. However, the
> count returned by strnlen_user should include the NULL byte. This patch
> fixes the __strnlen_user macro to include the NULL byte in the count.

Are you sure? Having strnlen and _foo_strnlen with different return
values seems very very dangerous.

> @@ -289,7 +289,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
> * Return 0 on exception, a value greater than N if too long
> */
> #ifndef __strnlen_user
> -#define __strnlen_user strnlen
> +#define __strnlen_user(s, n) (strnlen((s), (n)) + 1)
> #endif
>

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2011-05-13 15:57    [W:0.138 / U:5.092 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site