Whamcloud - gitweb
LU-13039 quota: Ensure local buffer is null terminated
[fs/lustre-release.git] / lustre / quota / qsd_lib.c
index da1c7c8..c535f90 100644 (file)
@@ -168,6 +168,7 @@ static ssize_t qsd_enabled_seq_write(struct file *file,
        if (copy_from_user(valstr, buffer, count))
                GOTO(out, count = -EFAULT);
 
+       valstr[sizeof(valstr) - 1] = 0;
        if (strchr(valstr, 'u'))
                enabled |= BIT(USRQUOTA);
        if (strchr(valstr, 'g'))