Fixing eal parameter issue when more than 64 bytes 50/72650/1
authorLuc Provoost <luc.provoost@intel.com>
Wed, 9 Jun 2021 11:51:31 +0000 (13:51 +0200)
committerLuc Provoost <luc.provoost@intel.com>
Wed, 9 Jun 2021 11:51:31 +0000 (13:51 +0200)
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 <luc.provoost@intel.com>
VNFs/DPPD-PROX/prox_args.c

index 178126f..9b76a43 100644 (file)
@@ -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];
                }
        }