From: Luc Provoost Date: Wed, 9 Jun 2021 11:51:31 +0000 (+0200) Subject: Fixing eal parameter issue when more than 64 bytes X-Git-Tag: 0.0.2~31 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F72650%2F1;p=samplevnf.git Fixing eal parameter issue when more than 64 bytes Using prox_strncpy to copy eal parameters, so PROX will abort in case the parameter exceeds the maximum string length. Also increased the string length from 64 to 256 bytes. Change-Id: Id7cee03f6b625e165342129e9c2c71216d1144e6 Signed-off-by: Luc Provoost --- diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c index 178126f6..9b76a43c 100644 --- a/VNFs/DPPD-PROX/prox_args.c +++ b/VNFs/DPPD-PROX/prox_args.c @@ -41,7 +41,7 @@ #include "ip_subnet.h" #define MAX_RTE_ARGV 64 -#define MAX_ARG_LEN 64 +#define MAX_ARG_LEN 256 struct cfg_depr { const char *opt; @@ -2295,7 +2295,7 @@ int prox_setup_rte(const char *prog_name) if (ptr) { *ptr++ = '\0'; } - strcpy(rte_arg[++argc], ptr2); + prox_strncpy(rte_arg[++argc], ptr2, MAX_ARG_LEN); rte_argv[argc] = rte_arg[argc]; } }