]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: fix code which uniquifies names in directory entries
authorTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jul 2012 17:05:46 +0000 (13:05 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jul 2012 17:05:46 +0000 (13:05 -0400)
When checking to see whether or not a new name is unique, the code was
using the wrong length parameter, which could cause the anti-collision
loop for a long time trying to find what it thinks is a unique name.

Addresses-Sourceforge-Bug: #3540545

Reported-by: Vitaly Oratovsky <vmo@users.sourceforge.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/rehash.c

index 15993b3f31ce8b9d0081461ddfe55ee072d3be92..aa7f406900ff76d61dc6ddc0ec505a0a82ab991d 100644 (file)
@@ -370,7 +370,7 @@ static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs,
                mutate_name(new_name, &new_len);
                for (j=0; j < fd->num_array; j++) {
                        if ((i==j) ||
-                           ((ent->dir->name_len & 0xFF) !=
+                           ((new_len & 0xFF) !=
                             (fd->harray[j].dir->name_len & 0xFF)) ||
                            (strncmp(new_name, fd->harray[j].dir->name,
                                     new_len & 0xFF)))