net/ark: fix buffer not null terminated

Coverity issue: 144512
Coverity issue: 144513
Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
Cc: stable@dpdk.org

Signed-off-by: John Miller <john.miller@atomicrules.com>
This commit is contained in:
John Miller 2017-05-16 12:14:15 -04:00 committed by Ferruh Yigit
parent c0802544d9
commit 79a158130f
2 changed files with 2 additions and 2 deletions

View File

@ -372,7 +372,7 @@ set_arg(char *arg, char *val)
o->v.INT = atoll(val);
break;
case OTSTRING:
strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;

View File

@ -354,7 +354,7 @@ pmd_set_arg(char *arg, char *val)
o->v.INT = atoll(val);
break;
case OTSTRING:
strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;