diff options
author | 2018-07-22 12:45:15 +0300 | |
---|---|---|
committer | 2018-07-24 15:15:25 +0000 | |
commit | 456ded496f93eb8156dc6e7b5a81d4a3aa604f60 (patch) | |
tree | 426faba1e7096e963e3d36c61d19c0fea9175205 /src/plugins/dpdk/device/flow.c | |
parent | c16a23c596169e76ee2b5091e2605c543659393d (diff) |
fix vector index range checks (VPP-1353)
Change-Id: I63c36644c9d93f2c3ec6606ca0205b407499de4e
Signed-off-by: Eyal Bari <ebari@cisco.com>
(cherry picked from commit cd30774fa9280736ffaea3e9a51948593e8eebc2)
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/flow.c')
-rw-r--r-- | src/plugins/dpdk/device/flow.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/dpdk/device/flow.c b/src/plugins/dpdk/device/flow.c index becd39704b8..351390b6d34 100644 --- a/src/plugins/dpdk/device/flow.c +++ b/src/plugins/dpdk/device/flow.c @@ -368,11 +368,10 @@ format_dpdk_flow (u8 * s, va_list * args) return s; } - fe = vec_elt_at_index (xd->flow_entries, private_data); - - if (!fe) + if (private_data >= vec_len (xd->flow_entries)) return format (s, "unknown flow"); + fe = vec_elt_at_index (xd->flow_entries, private_data); s = format (s, "mark %u", fe->mark); return s; } |