Unverified Commit 3a76bfcb authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4940 apparmor: avoid crash when parsed profile name is empty

parents df206699 343e3b3d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -696,6 +696,10 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)

	tmpname = aa_splitn_fqname(name, strlen(name), &tmpns, &ns_len);
	if (tmpns) {
		if (!tmpname) {
			info = "empty profile name";
			goto fail;
		}
		*ns_name = kstrndup(tmpns, ns_len, GFP_KERNEL);
		if (!*ns_name) {
			info = "out of memory";