diff options
author | Alex Shi <alex.shi@linaro.org> | 2015-06-24 13:13:32 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-06-24 13:13:32 +0800 |
commit | f5e3fc58ccc95572560d0beae9e4e7c1bd94ca6d (patch) | |
tree | 381f44794f20ea0de0b1882c60f8474a4b8097da /lib | |
parent | 488d2f6a829adce190e196358cd619e1b0c414a9 (diff) | |
parent | f651f58577a9d44e0d51bc24b895a4ddd056c97b (diff) |
Merge branch 'linux-linaro-lsk-v3.10' into linux-linaro-lsk-v3.10-android
Diffstat (limited to 'lib')
-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, 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)))) |