xfrm: make xfrm_alg_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
373b8eeb0c
commit
06cd22f830
@@ -42,7 +42,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
|
||||
return 0;
|
||||
|
||||
algp = nla_data(rt);
|
||||
if (nla_len(rt) < xfrm_alg_len(algp))
|
||||
if (nla_len(rt) < (int)xfrm_alg_len(algp))
|
||||
return -EINVAL;
|
||||
|
||||
switch (type) {
|
||||
|
Reference in New Issue
Block a user