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>
This commit is contained in:

committed by
Steffen Klassert

parent
06cd22f830
commit
1bd963a72e
@@ -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';
|
||||
|
Reference in New Issue
Block a user