Skip to content

dnsname parser treats invalid label length as compression #4851

@stbuehler

Description

@stbuehler
  • Program: all using the dnsname parser (probably all)
  • Issue type: Bug report

Short description

https://github.com/PowerDNS/pdns/blob/master/pdns/dnsname.cc#L121 uses if(labellen & 0xc0) to check for compression; so any label length octet with 0x80 or 0x40 bit set is treated as compressed reference, but compression should check for both bits being set, i.e. if(0xc0 == (labellen & 0xc0)).

Other information

0x40 and 0x80 are reserver for future use; if those two variants are actually allowed in the future, both ends would have to negotiate their use, as otherwise the other end would only see garbage.

Therefore it should be unlikely that this matters a lot - until pdns negotiates such future standard it doesn't need to handle it, and handling it wrong shouldn't break much, but it should be fixed anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions