table: fix out of bounds write
Fix out of bounds write. The allocated string size was incorrect. Coverity issue: 369670 Fixes: 66440b7b22f2 ("table: add wildcard match table type") Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
parent
ae650ff9ba
commit
97005a6665
@ -53,15 +53,14 @@ env_free(void *start, size_t size)
|
|||||||
|
|
||||||
static char *get_unique_name(void)
|
static char *get_unique_name(void)
|
||||||
{
|
{
|
||||||
char *name;
|
uint64_t tsc = rte_get_tsc_cycles();
|
||||||
uint64_t *tsc;
|
size_t size = sizeof(uint64_t) * 2 + 1;
|
||||||
|
char *name = calloc(1, size);
|
||||||
|
|
||||||
name = calloc(7, 1);
|
|
||||||
if (!name)
|
if (!name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tsc = (uint64_t *) name;
|
snprintf(name, size, "%016" PRIx64, tsc);
|
||||||
*tsc = rte_get_tsc_cycles();
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user