]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 05bd00b47a7bff20b4ef3eca3831202a8f29d87d..c5b384a119fdbe37fb2aa87808e61bc26c0bdd2d 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;