diff options
author | Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com> | 2017-10-05 03:37:35 +0530 |
---|---|---|
committer | Deepak S <deepak.s@linux.intel.com> | 2017-10-06 17:41:18 -0700 |
commit | 2280f91c9c4a2261f44e19dadb4f450ef6c92e77 (patch) | |
tree | a71278588d30257e00660fe9ee05708c392ac70e /common/vnf_common/vnf_common.c | |
parent | cd3527b101c97a66d02069a0d60c4e53b4a7d863 (diff) |
common code: KW fixes for common code
This patch fixes KW issues seen with the common code.
Change-Id: I4f90369152345ea2ea9316b04ac946c0c69fd7d1
Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Diffstat (limited to 'common/vnf_common/vnf_common.c')
-rw-r--r-- | common/vnf_common/vnf_common.c | 5 |
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)); } |