Whamcloud - gitweb
e4crypt: fix hexidecimal salt parsing
authorTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jun 2015 02:52:48 +0000 (22:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Jun 2015 02:52:48 +0000 (22:52 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/e4crypt.c

index 05bd00b..c5b384a 100644 (file)
@@ -302,7 +302,7 @@ static void parse_salt(char *salt_str, int flags)
                while (*cp) {
                        if (salt_len >= EXT4_MAX_SALT_SIZE)
                                goto invalid_salt;
-                       h = memchr(hexchars, *cp++, sizeof(hexchars));
+                       h = memchr(hexchars, *cp++, hexchars_size);
                        l = memchr(hexchars, *cp++, hexchars_size);
                        if (!h || !l)
                                goto invalid_salt;