Skip to content

error when decoding compressed domain name #5

@jiangzhuti

Description

@jiangzhuti

RFC 1035 4.1.4 says:

The compression scheme allows a domain name in a message to be represented as either:

  • a sequence of labels ending in a zero octet
  • a pointer
  • a sequence of labels ending with a pointer

so when decoding a dns packet which contains a pointer-ending CNAME at the end, the code runs here: https://github.com/mnezerka/dnslib/blob/master/src/buffer.cpp#L287
saveBuffPos is equal to the buffer's size, then, at line 290 setPos(saveBuffPos);, an exception is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions