提交 a61ecd32 编写于 作者: C Colin Ian King 提交者: John Johansen

apparmor: fix error returns checks by making size a ssize_t

Currently variable size is a unsigned size_t, hence comparisons to
see if it is less than zero (for error checking) will always be
false.  Fix this by making size a ssize_t

Detected by CoverityScan, CID#1466080 ("Unsigned compared against 0")

Fixes: 8e51f908 ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
上级 e540c3c9
......@@ -314,7 +314,7 @@ static int aa_xattrs_match(const struct linux_binprm *bprm,
struct aa_profile *profile, unsigned int state)
{
int i;
size_t size;
ssize_t size;
struct dentry *d;
char *value = NULL;
int value_size = 0, ret = profile->xattr_count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册