apparmor: fix arg_size computation for when setprocattr is null terminated

Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2016-07-09 23:46:33 -07:00
parent e89b808132
commit d4d03f74a7

View File

@ -529,7 +529,7 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,
if (!*args)
goto out;
arg_size = size - (args - (char *) value);
arg_size = size - (args - (largs ? largs : (char *) value));
if (strcmp(name, "current") == 0) {
if (strcmp(command, "changehat") == 0) {
error = aa_setprocattr_changehat(args, arg_size,