[2/4] net/softnic: fix string copy
Checks
Commit Message
From: Reshma Pattan <reshma.pattan@intel.com>
Replace strcpy with strlcpy to avoid buffer overrun.
Coverity issue: 323515
Fixes: b767f8efc8 ("net/softnic: replace pointers with arrays")
CC: cristian.dumitrescu@intel.com
CC: jasvinder.singh@intel.com
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
drivers/net/softnic/rte_eth_softnic_cli.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2485,7 +2485,8 @@ cmd_pipeline_table(struct pmd_internals *softnic,
return;
}
- strcpy(p.action_profile_name, tokens[t0 + 1]);
+ strlcpy(p.action_profile_name, tokens[t0 + 1],
+ sizeof(p.action_profile_name));
t0 += 2;
}