Issue Details (XML | Word | Printable)

Key: NET-155
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Krzysztof Jakubczyk
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

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

Created: 26/Mar/07 08:50 AM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 2.0

Time Tracking:
Not Specified

Environment: any

Resolution Date: 29/Mar/07 03:36 PM


 Description  « Hide
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)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rory Winston added a comment - 29/Mar/07 03:36 PM
Fix applied.