From 1c29f4306f557ef5d9ed515ec8881f4d1735b058 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 27 Sep 2016 10:34:19 -0300 Subject: Linux-libre 4.7.5-gnu --- arch/hexagon/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/hexagon/include/asm') diff --git a/arch/hexagon/include/asm/uaccess.h b/arch/hexagon/include/asm/uaccess.h index f000a382b..f61cfb28e 100644 --- a/arch/hexagon/include/asm/uaccess.h +++ b/arch/hexagon/include/asm/uaccess.h @@ -103,7 +103,8 @@ static inline long hexagon_strncpy_from_user(char *dst, const char __user *src, { long res = __strnlen_user(src, n); - /* return from strnlen can't be zero -- that would be rubbish. */ + if (unlikely(!res)) + return -EFAULT; if (res > n) { copy_from_user(dst, src, n); -- cgit v1.2.3-54-g00ecf