kernel -- Fix off-by-one in udp multicast group check code.
authorVenkatesh Srinivas <me@endeavour.zapto.org>
Mon, 4 Apr 2011 01:25:12 +0000 (18:25 -0700)
committerSascha Wildner <saw@online.de>
Thu, 7 Apr 2011 06:51:39 +0000 (08:51 +0200)
Triggered reliably by mt-daapd.

sys/netinet/udp_usrreq.c

index 77bf95a..9ac6773 100644 (file)
@@ -213,7 +213,7 @@ check_multicast_membership(struct ip *ip, struct inpcb *inp, struct mbuf *m)
        mopt = inp->inp_moptions;
        if (mopt == NULL)
                return (-1);
-       for (mshipno = 0; mshipno <= mopt->imo_num_memberships; ++mshipno) {
+       for (mshipno = 0; mshipno < mopt->imo_num_memberships; ++mshipno) {
                struct in_multi *maddr = mopt->imo_membership[mshipno];
 
                if (ip->ip_dst.s_addr == maddr->inm_addr.s_addr &&