diff options
Diffstat (limited to 'lib/strnlen_user.c')
-rw-r--r-- | lib/strnlen_user.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c index a28df5206d95..11649615c505 100644 --- a/lib/strnlen_user.c +++ b/lib/strnlen_user.c | |||
@@ -57,7 +57,8 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count, | |||
57 | return res + find_zero(data) + 1 - align; | 57 | return res + find_zero(data) + 1 - align; |
58 | } | 58 | } |
59 | res += sizeof(unsigned long); | 59 | res += sizeof(unsigned long); |
60 | if (unlikely(max < sizeof(unsigned long))) | 60 | /* We already handled 'unsigned long' bytes. Did we do it all ? */ |
61 | if (unlikely(max <= sizeof(unsigned long))) | ||
61 | break; | 62 | break; |
62 | max -= sizeof(unsigned long); | 63 | max -= sizeof(unsigned long); |
63 | if (unlikely(__get_user(c,(unsigned long __user *)(src+res)))) | 64 | if (unlikely(__get_user(c,(unsigned long __user *)(src+res)))) |