Skip to content

Incorrect pointer passed to dn_comp #25

@MattCatz

Description

@MattCatz

While investigating crash mentioned in #24,

It seems like here:

mdnsd/dns.c

Line 90 in 2f75344

dnptrs[0] = (unsigned char *)&pkt;

We are passing a pointer to the entire pkt struct (header and data). This allows dn_comp to occasionally muck with the pkt header. We should be passing a pointer to just the buffer (pkt.data).

On a tangent, since MAX_NAME_LEN is always used for the length check (regardless of the name length) the effectively max length of the data buffer is around 900 bytes. Which should be enough for most cases but does mean 90% of the allocated space will go unused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions