summaryrefslogtreecommitdiff
path: root/drivers/net/softnic
diff options
context:
space:
mode:
authorPallantla Poornima <pallantlax.poornima@intel.com>2019-02-04 07:23:48 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-01 18:17:36 +0100
commitfef6b216390f33c066ea15e9de7845dfc3ab6d6a (patch)
tree0cb2e666b48af501b6ab090cf5ac5c13dbbd3607 /drivers/net/softnic
parent6416a618436a843c3e57882bb06e42cf0a370d1c (diff)
downloaddpdk-fef6b216390f33c066ea15e9de7845dfc3ab6d6a.zip
dpdk-fef6b216390f33c066ea15e9de7845dfc3ab6d6a.tar.gz
dpdk-fef6b216390f33c066ea15e9de7845dfc3ab6d6a.tar.xz
net/softnic: fix possible buffer overflow
sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used. Fixes: daabf2fb949b ("net/softnic: map flow action to table action") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/softnic')
-rw-r--r--drivers/net/softnic/rte_eth_softnic_flow.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c
index 21e7530..aefc384 100644
--- a/drivers/net/softnic/rte_eth_softnic_flow.c
+++ b/drivers/net/softnic/rte_eth_softnic_flow.c
@@ -1283,7 +1283,8 @@ flow_rule_action_get(struct pmd_internals *softnic,
action,
"QUEUE: Invalid RX queue ID");
- sprintf(name, "RXQ%u", (uint32_t)conf->index);
+ snprintf(name, sizeof(name), "RXQ%u",
+ (uint32_t)conf->index);
status = softnic_pipeline_port_out_find(softnic,
pipeline->name,
@@ -1373,7 +1374,7 @@ flow_rule_action_get(struct pmd_internals *softnic,
action,
"RSS: Invalid RX queue ID");
- sprintf(name, "RXQ%u",
+ snprintf(name, sizeof(name), "RXQ%u",
(uint32_t)conf->queue[i]);
status = softnic_pipeline_port_out_find(softnic,