summaryrefslogtreecommitdiffstats
path: root/common/vnf_common/vnf_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/vnf_common/vnf_common.c')
-rw-r--r--common/vnf_common/vnf_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/vnf_common/vnf_common.c b/common/vnf_common/vnf_common.c
index 93687fd6..ff0039bc 100644
--- a/common/vnf_common/vnf_common.c
+++ b/common/vnf_common/vnf_common.c
@@ -141,10 +141,11 @@ void trim(char *input)
char result[len + 1];
memset(result, 0, sizeof(result));
- for (i = 0; input[i] != '\0'; i++) {
+ for (i = 0; (input[i] != '\0') && (i < PIPELINE_MAX_ARGS); i++) {
if (!isspace(input[i]))
result[j++] = input[i];
}
+ result[j] = '\0';
- strncpy(input, result, len);
+ strncpy(input, result, strlen(result));
}