Skip to content

nil pointer dereference #119

@boydjeff

Description

@boydjeff

There are network situations where multicast is disabled for IPv6, but not IPv4. And there are situations where the network may change (if you need to connect and disconnect from a VPN, for example). If the user has not set DisableIPv6 in the QueryParam struct to true, then a segfault may occur. I've created a PR for a fix (#118), and given details of how the pieces fall in place for a segfault in the description.

As I've looked at the other Issues and PRs for this library, I see that my PR really should be combined with #87. PR#87 sets both mconn6 and uconn6 to nil if either is nil. As I thought about it, my PR#118 can be ignored completely if PR#87 is changed to add v6 = false in the if block. This has the same effect of the user setting DisableIPv6 to true, but it's like mdns has tested the environment and seen that IPv6 is not viable for both unicast and multicast and sets DisableIPv6 to true for the user. Perhaps adding a log message and setting v6 to false is the right way to go.

So, I'm proposing mdns use one of two solutions:

  1. Merge both fix ipv6 sendto: no route to host #87 and Prevent a nil pointer dereference segfault #118
  2. Add a log message and v6 = false inside the if block in fix ipv6 sendto: no route to host #87

This issue might be a duplicate of #43, but that issue is old, therefore doesn't reflect the latest code, and lacks detail to know for sure.

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