Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa736c36 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Paul Moore
Browse files

selinux: use kmemdup in security_sid_to_context_core()

parent 20ba96ae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1259,12 +1259,12 @@ static int security_sid_to_context_core(u32 sid, char **scontext,
			*scontext_len = strlen(initial_sid_to_string[sid]) + 1;
			if (!scontext)
				goto out;
			scontextp = kmalloc(*scontext_len, GFP_ATOMIC);
			scontextp = kmemdup(initial_sid_to_string[sid],
					    *scontext_len, GFP_ATOMIC);
			if (!scontextp) {
				rc = -ENOMEM;
				goto out;
			}
			strcpy(scontextp, initial_sid_to_string[sid]);
			*scontext = scontextp;
			goto out;
		}