Unverified Commit 27b1ea83 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4961 [sync] PR-4940: apparmor: avoid crash when parsed profile name is empty

parents 9447b8bf 63456346
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";