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:
parent
c0802544d9
commit
79a158130f
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user