commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krzysztof Jakubczyk (JIRA)" <j...@apache.org>
Subject [jira] Created: (NET-155) Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)
Date Mon, 26 Mar 2007 08:52:32 GMT
Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)
---------------------------------------------------------------------------------------------------

                 Key: NET-155
                 URL: https://issues.apache.org/jira/browse/NET-155
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 1.4
         Environment: any
            Reporter: Krzysztof Jakubczyk


running the following code:

  client.connect("news.icm.edu.pl");
  NewsgroupInfo[] grps = client.listNewsgroups();

results MalformedServerReplyException (alt.atheism 2147485259 2147483647 y)

it's because in function NNTPClient.__parseNewsgroupListEntry():

last = tokenizer.nextToken();
        first = tokenizer.nextToken();
        permission = tokenizer.nextToken();

        try
        {
            lastNum = Integer.parseInt(last);
            firstNum = Integer.parseInt(first);
            result._setFirstArticle(firstNum);
            result._setLastArticle(lastNum);

	    if((firstNum == 0) && (lastNum == 0))
		    result._setArticleCount(0);
	    else
		    result._setArticleCount(lastNum - firstNum + 1);
        }
        catch (NumberFormatException e)
        {
            return null;
        }

lastNum and firstNum are Integer (too small for received values)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message