bug fix: catch bad use of dirs= options (extra ':' separators)
authorErez_Zadok <ezk@cs.sunysb.edu>
Fri, 25 May 2007 21:01:00 +0000 (17:01 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:23:51 +0000 (22:23 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/main.c

index decefef3c720241cbe8f1adac81d9f9efe1ee646..a690182da5e116bf794712970acf5d2618d759e4 100644 (file)
@@ -320,8 +320,12 @@ static int parse_dirs_option(struct super_block *sb, struct unionfs_dentry_info
                int perms;
                char *mode = strchr(name, '=');
 
-               if (!name || !*name)
+               if (!name)
                        continue;
+               if (!*name) {   /* bad use of ':' (extra colons) */
+                       err = -EINVAL;
+                       goto out;
+               }
 
                branches++;