diff options
| -rw-r--r-- | security/integrity/evm/evm_secfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index cf5cd303d7c0..3cefef3919e5 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c | |||
| @@ -209,7 +209,7 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, | |||
| 209 | 209 | ||
| 210 | /* Remove any trailing newline */ | 210 | /* Remove any trailing newline */ |
| 211 | len = strlen(xattr->name); | 211 | len = strlen(xattr->name); |
| 212 | if (xattr->name[len-1] == '\n') | 212 | if (len && xattr->name[len-1] == '\n') |
| 213 | xattr->name[len-1] = '\0'; | 213 | xattr->name[len-1] = '\0'; |
| 214 | 214 | ||
| 215 | if (strcmp(xattr->name, ".") == 0) { | 215 | if (strcmp(xattr->name, ".") == 0) { |
