Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-155

Integer is too small to hold article number value (NNTPClient __parseNewsgroupListEntry() function)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 2.0
    • None
    • None
    • any

    Description

      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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            uhzzre Krzysztof Jakubczyk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: