Whamcloud - gitweb
- added few sanity check to seq_proc_write_range()
authoryury <yury>
Thu, 22 Jun 2006 11:48:45 +0000 (11:48 +0000)
committeryury <yury>
Thu, 22 Jun 2006 11:48:45 +0000 (11:48 +0000)
lustre/fid/lproc_fid.c

index 141be0a..e0691d8 100644 (file)
@@ -62,6 +62,13 @@ seq_proc_write_range(struct file *file, const char *buffer,
         rc = sscanf(buffer, "["LPU64"-"LPU64"]\n",
                    &tmp.lr_start, &tmp.lr_end);
 
+       /* did not match 2 values */
+       if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp)) {
+               CERROR("can't parse input string or "
+                      "input is not correct\n");
+               RETURN(count);
+       }
+
        *range = tmp;
         RETURN(count);
 }