aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/integrity/ima/ima_policy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index bf232b98011e..d2c47d4df7b7 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -696,8 +696,9 @@ ssize_t ima_parse_add_rule(char *rule)
696 696
697 p = strsep(&rule, "\n"); 697 p = strsep(&rule, "\n");
698 len = strlen(p) + 1; 698 len = strlen(p) + 1;
699 p += strspn(p, " \t");
699 700
700 if (*p == '#') 701 if (*p == '#' || *p == '\0')
701 return len; 702 return len;
702 703
703 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 704 entry = kzalloc(sizeof(*entry), GFP_KERNEL);