]> git.droids-corp.org - dpdk.git/commitdiff
examples/l2fwd-crypto: fix port mask overflow
authorBrian Dooley <brian.dooley@intel.com>
Mon, 21 Feb 2022 18:06:58 +0000 (18:06 +0000)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 23 Feb 2022 10:50:02 +0000 (11:50 +0100)
Coverity flags an issue with 32-bit value. If max ethports value is
configured with a value larger than 32 there will be an issue.
Coverity issue: 375863 Unintentional integer overflow

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
examples/l2fwd-crypto/main.c

index 4d9f8861af9df4e2018a6a5b053fcb8c456908b6..bbdb263143de009599f81497d5b0ed4ff2f9f592 100644 (file)
@@ -2719,7 +2719,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
                        last_portid = portid;
                }
 
-               l2fwd_enabled_port_mask |= (1 << portid);
+               l2fwd_enabled_port_mask |= (1ULL << portid);
                enabled_portcount++;
        }