X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fnetlink.c;fp=avahi-core%2Fnetlink.c;h=893295dd741bc8ab4c321bc8dceef8cbe7cfe97d;hb=71ef4b773ae4cc737dde645b76b8ffa0ace227e5;hp=b2a6684c60445fd93356a6ec789c47863990cbdf;hpb=25681df85706bbdc5d6ad011537b7b4f7d05cae5;p=catta diff --git a/avahi-core/netlink.c b/avahi-core/netlink.c index b2a6684..893295d 100644 --- a/avahi-core/netlink.c +++ b/avahi-core/netlink.c @@ -62,6 +62,12 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) { p = (struct nlmsghdr *) nl->buffer; + /* Check that this message originated from the kernel, + or a request from avahi itself, and not another process */ + if ((p->nlmsg_pid != 0) && (p->nlmsg_pid != getpid())) { + return -1; + } + assert(nl->callback); for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {