Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option length field miscalculation of 15 #3

Open
GoogleCodeExporter opened this issue Aug 18, 2015 · 1 comment
Open

Option length field miscalculation of 15 #3

GoogleCodeExporter opened this issue Aug 18, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hi,

According to the draft-coap-7 the optional length is split in length lower then 
15 or hight for the next length field.

so,

length < 15 then the long length is 0,
but when the length > 15 then the over flowing length is placed into the long 
length value - 15.

example:
 total length = 17.
 results into short length = 15, long length = 2

in the current implementation of jcoap this substraction isn't done.

bugfix can be done in the file CoapHeaderOptions function deserialize, line 78
tmpLength = tmp.getLongLength() + 15;

end for serialization :

CoapHeaderOption
line 37,  longLength = value.length-15;


regards,




Original issue reported on code.google.com by [email protected] on 7 Oct 2011 at 11:21

@GoogleCodeExporter
Copy link
Author

The issue is still present since the length in the latest standard is actually 
13 and not 15. The fix is easy.

Original comment by [email protected] on 13 May 2015 at 2:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant