Roman Rakus 99e8fc
diff -up authd-1.4.3/authd.c.jiffies64 authd-1.4.3/authd.c
Roman Rakus 6b5971
--- authd-1.4.3/authd.c.jiffies64	2004-11-16 00:25:24.000000000 +0100
Roman Rakus 6b5971
+++ authd-1.4.3/authd.c	2008-03-25 11:22:35.000000000 +0100
Roman Rakus 6b5971
@@ -347,6 +347,22 @@ static void create_opt(int argc, char *a
Roman Rakus 5afcbd
 
Roman Rakus 5afcbd
 static const char *const DELIM = ",: \t\r\n\v\f";
Roman Rakus 5afcbd
 
Roman Rakus 6b5971
+static unsigned long long get_tok_ullong(char *s, unsigned base) {
Roman Rakus 6b5971
+    unsigned long long ull = ULLONG_MAX;
Roman Rakus 6b5971
+
Roman Rakus 6b5971
+    assert(base <= 36);
Roman Rakus 6b5971
+    if ((s = strtok(s, DELIM)) != NULL) {
Roman Rakus 6b5971
+        char *endptr;
Roman Rakus 6b5971
+
Roman Rakus 6b5971
+        ull = strtoull(s, &endptr, (int) base);
Roman Rakus 6b5971
+        if ((errno == ERANGE && ull == ULLONG_MAX) || is_bad_strto(s, endptr))
Roman Rakus 6b5971
+            errno = EINVAL;
Roman Rakus 6b5971
+    }
Roman Rakus 6b5971
+    else errno = EINVAL;
Roman Rakus 6b5971
+    return ull;
Roman Rakus 5afcbd
+}
Roman Rakus 5afcbd
+
Roman Rakus 99e8fc
+
Roman Rakus 6b5971
 static unsigned long get_tok_uint(char *s, unsigned base) {
Roman Rakus 6b5971
     unsigned long ul = ULONG_MAX;
Roman Rakus 5afcbd
 
Roman Rakus 6b5971
@@ -643,7 +659,7 @@ static bool get_info(reply_t *out, reque
Roman Rakus 5afcbd
         (void) get_tok_uint(NULL, 16);            // tx_queue
Roman Rakus 5afcbd
         (void) get_tok_uint(NULL, 16);            // rx_queue
Roman Rakus 5afcbd
         (void) get_tok_uint(NULL, 16);            // tr (boolean)
Roman Rakus 5afcbd
-        (void) get_tok_uint(NULL, 16);            // tm->when (unit: jiffies)
Roman Rakus 6b5971
+        (void) get_tok_ullong(NULL, 16);            // tm->when (unit: jiffies)
Roman Rakus 5afcbd
         strtok(NULL, DELIM);                      // retrnsmt
Roman Rakus 5afcbd
         uid = get_tok_uint(NULL, 10);             // uid (base 10 uint)
Roman Rakus 5afcbd
         strtok(NULL, DELIM);                      // timeout