app/testpmd: fix memory access error for metering CLI
PATCH 1/1 app/testpmd: fix memory access error for metering CLI
Fix memory access (out of bounds write) error, color and action assignments.
Coverity issue: 198437
Fixes 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Signed-off-by Jasvinder Singh <[email protected]>
--- app/test-pmd/cmdline_mtr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
app/test-pmd/cmdline_mtr.c +2 -4
@@ -802,17 +802,15 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result, color =RTE_MTR_GREEN ; else if (strcmp(c, "Y") == 0) color =RTE_MTR_YELLOW ; - else if (strcmp(c, "Y") == 0) - color =RTE_MTR_RED ; else - color =RTE_MTR_COLORS ; + color =RTE_MTR_RED ;/* Action */ if (strcmp (a,"G" ) ==0 ) action[color] =MTR_POLICER_ACTION_COLOR_GREEN ;else if (strcmp (a,"Y" ) ==0 ) action[color] =MTR_POLICER_ACTION_COLOR_YELLOW ; -else if (strcmp (a,"Y" ) ==0 ) +else if (strcmp (a,"R" ) ==0 ) action[color] =MTR_POLICER_ACTION_COLOR_RED ;else action[color] =MTR_POLICER_ACTION_DROP ;
Signature · 1 line
2.9.3
Quoted 7 lines · Jasvinder Singh
Fix memory access (out of bounds write) error, color and action assignments.
Coverity issue: 198437
Fixes 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")Signed-off-by Jasvinder Singh <[email protected]>
Reviewed-by Ferruh Yigit <[email protected]>
Ferruh Yigit
AppliedQuoted 10 lines · Ferruh Yigit
Quoted 7 lines · Jasvinder Singh
Fix memory access (out of bounds write) error, color and action assignments.
Coverity issue: 198437
Fixes 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")Signed-off-by Jasvinder Singh <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied to dpdk/master, thanks.