summaryrefslogtreecommitdiff
path: root/lib/librte_lpm
diff options
context:
space:
mode:
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>2016-04-27 17:07:53 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-05-02 15:15:45 +0200
commit9199cd6d51737a4f1e5a3170ff3d1d38258243ee (patch)
tree63657bae4a98fd76aee6d30924d6102aea2f371b /lib/librte_lpm
parent6226aa5672001673ef2eadf15c819862472277f4 (diff)
downloaddpdk-9199cd6d51737a4f1e5a3170ff3d1d38258243ee.zip
dpdk-9199cd6d51737a4f1e5a3170ff3d1d38258243ee.tar.gz
dpdk-9199cd6d51737a4f1e5a3170ff3d1d38258243ee.tar.xz
lpm6: fix possible garbage in lookup
Fix issue reported by clang scan-build Value of pointer tbl_next was uninitialized. When function lookup_step() take else branch it may provide garbage into tbl = tbl_next; Fixes: 5c510e13a9cb ("lpm: add IPv6 support") Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Diffstat (limited to 'lib/librte_lpm')
-rw-r--r--lib/librte_lpm/rte_lpm6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c
index ba4353c..32fdba0 100644
--- a/lib/librte_lpm/rte_lpm6.c
+++ b/lib/librte_lpm/rte_lpm6.c
@@ -601,7 +601,7 @@ int
rte_lpm6_lookup(const struct rte_lpm6 *lpm, uint8_t *ip, uint8_t *next_hop)
{
const struct rte_lpm6_tbl_entry *tbl;
- const struct rte_lpm6_tbl_entry *tbl_next;
+ const struct rte_lpm6_tbl_entry *tbl_next = NULL;
int status;
uint8_t first_byte;
uint32_t tbl24_index;
@@ -636,7 +636,7 @@ rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm,
{
unsigned i;
const struct rte_lpm6_tbl_entry *tbl;
- const struct rte_lpm6_tbl_entry *tbl_next;
+ const struct rte_lpm6_tbl_entry *tbl_next = NULL;
uint32_t tbl24_index;
uint8_t first_byte, next_hop;
int status;