OSDN Git Service

debugfs: fix a bug in string_to_time() which misparsed @NNNNNNN inputs
authorTheodore Ts'o <tytso@mit.edu>
Mon, 14 Mar 2016 17:54:41 +0000 (13:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Mar 2016 17:54:41 +0000 (13:54 -0400)
Thanks to David Turner <novalis@novalis.org> for reporting this bug.

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

index 770e7e1..bd5de79 100644 (file)
@@ -232,7 +232,7 @@ extern __s64 string_to_time(const char *arg)
                /* interpret it as an integer */
                arg++;
        fallback:
-               ret = strtoll(arg+1, &tmp, 0);
+               ret = strtoll(arg, &tmp, 0);
                if (*tmp)
                        return -1;
                return ret;