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

Problem with stun #21

Open
ravenrani opened this issue Sep 11, 2024 · 4 comments
Open

Problem with stun #21

ravenrani opened this issue Sep 11, 2024 · 4 comments

Comments

@ravenrani
Copy link

arraycopy: last destination index 24 out of bounds for byte[20]
java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 24 out of bounds for byte[20]
at java.base/java.lang.System.arraycopy(Native Method)
at de.javawi.jstun.attribute.ErrorCode.getBytes(ErrorCode.java:79)
at de.javawi.jstun.attribute.MessageAttribute.getLength(MessageAttribute.java:76)
at de.javawi.jstun.header.MessageHeader.parseAttributes(MessageHeader.java:157)
at de.javawi.jstun.test.DiscoveryTest.test2(DiscoveryTest.java:193)
at de.javawi.jstun.test.DiscoveryTest.test(DiscoveryTest.java:65)
at de.javawi.jstun.test.demo.DiscoveryTestDemo.run(DiscoveryTestDemo.java:78)
at java.base/java.lang.Thread.run(Thread.java:834)

Got the following error, probably some parsing inconsistency, cause this came back from coturn stun

@tking
Copy link
Owner

tking commented Sep 11, 2024

Could you please share the input data? It looks like the input data is malformed!

@ravenrani
Copy link
Author

ravenrani commented Sep 11, 2024

Hi, this is the data returned in hex that is causing the issue -
Data : 01110070f4a21402935aef2941f7426af83c01ab0009004c00000414556e6b6e6f776e206174747269627574653a205455524e207365727665722077617320636f6e6669677572656420776974686f757420524643203537383020737570706f727400008022001c436f7475726e2d342e352e32202764616e20456964657227000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
arraycopy: last destination index 24 out of bounds for byte[20]

this is the place in the code where I added the print - (if fails in the parseAttributes)
image

@ravenrani ravenrani reopened this Sep 11, 2024
@tking
Copy link
Owner

tking commented Sep 11, 2024

Thanks for sharing the hex data. It looks malformed to me. How do you see it (what does Wireshark tell you)?

@ravenrani
Copy link
Author

o.k., it seems like it is a problem within the code.
I tried also this one : stun.f.haeder.net (port 3478)
There is a problem in parsing the result
Very same error there.

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

No branches or pull requests

2 participants