]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
fix uninitialized memory in tc_skbedit
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 19 Feb 2009 16:59:06 +0000 (08:59 -0800)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 19 Feb 2009 16:59:06 +0000 (08:59 -0800)
Original from: Alexander Duyck <alexander.h.duyck@intel.com>

A bug was found in which the memory for the tc_skbedit struct was being
used uninitialized to 0.  Alternative version of original fix
using initializer rather than memset.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
tc/m_skbedit.c

index 55e3f89e4db9386f8a4b191ba8c3dab95165d438..9044353d39440f00efc8be719c8c56a1cf138d3b 100644 (file)
@@ -48,7 +48,6 @@ static int
 parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
              struct nlmsghdr *n)
 {
-       struct tc_skbedit sel;
        int argc = *argc_p;
        char **argv = *argv_p;
        int ok = 0;
@@ -56,6 +55,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
        unsigned int tmp;
        __u16 queue_mapping;
        __u32 flags = 0, priority;
+       struct tc_skbedit sel = { 0 };
 
        if (matches(*argv, "skbedit") != 0)
                return -1;