UBUNTU: SAUCE: ndiswrapper: Initialize buffer index and check its value
authorLeann Ogasawara <leann.ogasawara@canonical.com>
Wed, 8 Sep 2010 16:13:41 +0000 (09:13 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:49:15 +0000 (06:49 -0700)
BugLink: http://bugs.launchpad.net/bugs/613796

The following commit propagated a change to ndiswrapper which originated
from upstream to convert multicast list to list_head.

  commit e2fce7c6af6e1bcd2f577304a5200738d076d98f
  Author: Leann Ogasawara <leann.ogasawara@canonical.com>
  Date:   Thu Jun 3 13:34:15 2010 -0700

    UBUNTU: SAUCE: ndiswrapper: convert multicast list to list_head

In making the change we accidentally forgot to carry forward
initialization of a buffer index and properly check its value.  Add this
missing functionality which previously existed.

We should squash this patch with commit e2fce7c6a upon the next rebase.

Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>

ubuntu/ndiswrapper/wrapndis.c

index 2ac89e7..12be7bc 100644 (file)
@@ -966,7 +966,10 @@ static void set_multicast_list(struct ndis_device *wnd)
                        WARNING("couldn't allocate memory");
                        EXIT2(return);
                }
+               i = 0;
                netdev_for_each_mc_addr(ha, net_dev) {
+                       if (i >= size)
+                               break;
                        if (net_dev->addr_len != ETH_ALEN)
                                continue;
                        memcpy(buf + i * ETH_ALEN, ha->addr, ETH_ALEN);