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

TXT record parsing fails when data length is 0 #14

Open
darmbrust opened this issue Apr 21, 2020 · 2 comments
Open

TXT record parsing fails when data length is 0 #14

darmbrust opened this issue Apr 21, 2020 · 2 comments

Comments

@darmbrust
Copy link

Exception in thread "Thread-2" java.nio.BufferUnderflowException
at java.base/java.nio.HeapByteBuffer.get(HeapByteBuffer.java:178)
at java.base/java.nio.ByteBuffer.get(ByteBuffer.java:762)
at net.straylightlabs.hola.dns.Record.readLabel(Record.java:122)
at net.straylightlabs.hola.dns.Record.readStringsFromBuffer(Record.java:137)
at net.straylightlabs.hola.dns.TxtRecord.(TxtRecord.java:39)
at net.straylightlabs.hola.dns.Record.fromBuffer(Record.java:74)
at net.straylightlabs.hola.dns.Response.parseRecords(Response.java:77)
at net.straylightlabs.hola.dns.Response.createFrom(Response.java:45)
at net.straylightlabs.hola.sd.Query.collectResponses(Query.java:218)

@darmbrust
Copy link
Author

screenshot17

Wireshark capture of the response in question

darmbrust added a commit to Sagebits/hola that referenced this issue Apr 22, 2020
@darmbrust
Copy link
Author

fixed in the above commit on my fork, if you need a release, see https://github.com/Sagebits/hola/releases/tag/v0.2.4-sagebits

also published to maven central as

<dependency>
	<groupId>net.sagebits</groupId>
	<artifactId>hola</artifactId>
	<version>0.2.4-sagebits</version>
</dependency>

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

1 participant