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: 8e51f9087f ("apparmor: Add support for attaching profiles via xattr, presence and value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Colin Ian King 2018-03-23 23:34:22 +00:00 committed by John Johansen
parent e540c3c901
commit a61ecd329c

View File

@ -314,7 +314,7 @@ static int aa_xattrs_match(const struct linux_binprm *bprm,
struct aa_profile *profile, unsigned int state) struct aa_profile *profile, unsigned int state)
{ {
int i; int i;
size_t size; ssize_t size;
struct dentry *d; struct dentry *d;
char *value = NULL; char *value = NULL;
int value_size = 0, ret = profile->xattr_count; int value_size = 0, ret = profile->xattr_count;