Fix overflow in port command which led to an assertion failure.
authorWerner Koch <wk@gnupg.org>
Wed, 31 Mar 2004 17:09:18 +0000 (17:09 +0000)
committerWerner Koch <wk@gnupg.org>
Wed, 31 Mar 2004 17:09:18 +0000 (17:09 +0000)
src/ftp_command.c

index a764a93..b9384d2 100644 (file)
@@ -596,7 +596,7 @@ static const char *parse_number(int *num, const char *s, int max_num)
         cur_digit = (*s - '0');
 
         /* check for overflow */
-        if ((max_num - cur_digit) < tmp) {
+        if ((max_num - cur_digit) < (tmp*10)) {
            return NULL;
        }