Skip to content
Snippets Groups Projects
Commit 9d5efcb5 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

udp: fix null dereference on OS X (Sierra)

parent 07643d23
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ static void udp_pktinfo_handle(const struct msghdr *rx, struct msghdr *tx)
* will be ignored. We need to use correct one.
*/
struct cmsghdr *cmsg = CMSG_FIRSTHDR(tx);
if (cmsg->cmsg_type == IP_PKTINFO) {
if (cmsg != NULL && cmsg->cmsg_type == IP_PKTINFO) {
struct in_pktinfo *info = (struct in_pktinfo *)CMSG_DATA(cmsg);
info->ipi_spec_dst = info->ipi_addr;
info->ipi_ifindex = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment