baokunzhao / ice4j

Automatically exported from code.google.com/p/ice4j
0 stars 0 forks source link

LifetimeAttribute decodes incorrect location in message bytes #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. connection using a turn server relay
2.
3.

What is the expected output? What do you see instead?
expected turn allocation timeout from turn server is suppose to be 600 for 10 
minutes but instead read it as a huge number instead.

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.

method decodeAttributeBody in class LifetimeAttribute is reading the wrong byte 
offset, hard-coded to be from zero.
should be changed to 

lifetime = ((attributeValue[offset] << 24) & 0xff000000) +
            ((attributeValue[offset+1] << 16) & 0x00ff0000) +
            ((attributeValue[offset+2] << 8) & 0x0000ff00) +
            (attributeValue[offset+3] & 0x000000ff);

Original issue reported on code.google.com by ekf...@gmail.com on 20 May 2014 at 10:31

Attachments: