x86_64: Fix strnlen_user() to not touch memory after specified maximum
[pandora-kernel.git] / arch / x86 / lib / usercopy_64.c
index 554b7b5..433b21d 100644 (file)
@@ -113,7 +113,7 @@ long __strnlen_user(const char __user *s, long n)
        char c;
 
        while (1) {
-               if (res>n)
+               if (res >= n)
                        return n+1;
                if (__get_user(c, s))
                        return 0;