From: Theodore Ts'o Date: Mon, 2 Mar 2015 16:40:18 +0000 (-0500) Subject: e2fsck: fix spurious duplicate directory entries with encrypted filenames X-Git-Tag: v1.43-WIP-2015-05-18~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baa14bd17fb7f83b8f95e32318a7319a762ce000;p=thirdparty%2Fe2fsprogs.git e2fsck: fix spurious duplicate directory entries with encrypted filenames 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 --- diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 33e485461..a6624f4d9 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -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); } /*