Whamcloud - gitweb
e2fsck: fix spurious duplicate directory entries with encrypted filenames
authorTheodore Ts'o <tytso@mit.edu>
Mon, 2 Mar 2015 16:40:18 +0000 (11:40 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 2 Mar 2015 16:40:18 +0000 (11:40 -0500)
Use memcmp() instead of strncmp() since encrypted directory names can
contain NUL characters.  For non-encrypted directories, we've already
checked for the case of NUL characters in file names, so it's safe to
use memcmp() here in all cases.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass2.c

index 33e4854..a6624f4 100644 (file)
@@ -314,7 +314,7 @@ static int dict_de_cmp(const void *a, const void *b)
        if (a_len != b_len)
                return (a_len - b_len);
 
-       return strncmp(de_a->name, de_b->name, a_len);
+       return memcmp(de_a->name, de_b->name, a_len);
 }
 
 /*