commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32363] - extra byte in WRQ TFTP packet
Date Wed, 24 Nov 2004 12:23:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32363>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32363


francois.duchatelet@skynet.be changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




------- Additional Comments From francois.duchatelet@skynet.be  2004-11-24 13:23 -------
The bug lies in the fact that Commons::Net adds an extraneous 0 byte after the 
MODE string.
So it is interpreted by the server as an empty option.

Culprit: TFTPRequestPacket.java, line 194:
        datagram.setLength(fileLength + modeLength + 4);

Where the 4 is 2 bytes for the type field and 2 times 1 terminating null byte.
But, modeLength already accounted for this null byte.

Then the packet is 1 byte too long, and this byte is interpreted as an empty 
TFTPv2 option. 

Code should be:
        datagram.setLength(fileLength + modeLength + 3);

Cheers,

François


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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