summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2017-09-21 22:47:09 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2017-09-25 07:14:06 +0200
commit1bd963a72e859d194d87a5a2a8839efee7e23102 (patch)
treeee5b1c33339db67950d7f8bcf34d0ae466aa02e2 /net/xfrm/xfrm_user.c
parentxfrm: make xfrm_alg_len() return unsigned int (diff)
downloadlinux-1bd963a72e859d194d87a5a2a8839efee7e23102.tar.xz
linux-1bd963a72e859d194d87a5a2a8839efee7e23102.zip
xfrm: make xfrm_alg_auth_len() return unsigned int
Key lengths can't be negative. Comparison with nla_len() is left signed just in case negative value can sneak in there. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 09512d90e6a5..465c23d4ea78 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -68,7 +68,7 @@ static int verify_auth_trunc(struct nlattr **attrs)
return 0;
algp = nla_data(rt);
- if (nla_len(rt) < xfrm_alg_auth_len(algp))
+ if (nla_len(rt) < (int)xfrm_alg_auth_len(algp))
return -EINVAL;
algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';