aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de>2016-08-01 13:36:04 +0200
committerMoyster <oysterized@gmail.com>2016-08-26 16:16:45 +0200
commit83da961803a184316d128189acee4764b3739b7b (patch)
tree976a842581ad26036a38badedcad59a6ff442581 /lib
parent6117aabd7c9a3441063503fe2603d0fced723e27 (diff)
3.10.79 -> 3.10.80
Diffstat (limited to 'lib')
-rw-r--r--lib/strnlen_user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index a28df5206..11649615c 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,
return res + find_zero(data) + 1 - align;
}
res += sizeof(unsigned long);
- if (unlikely(max < sizeof(unsigned long)))
+ /* We already handled 'unsigned long' bytes. Did we do it all ? */
+ if (unlikely(max <= sizeof(unsigned long)))
break;
max -= sizeof(unsigned long);
if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))