vhost: fix malloc in rte_vhost_get_mem_table
Amount of allocated memory was too small, causing buffer overflow. Change-Id: Ib43e0a9040f594fed0a8c5660a45aeb07e4400c7 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
This commit is contained in:
parent
2542779301
commit
13657c7d75
@ -369,7 +369,7 @@ rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem)
|
||||
return -1;
|
||||
|
||||
size = dev->mem->nregions * sizeof(struct rte_vhost_mem_region);
|
||||
m = malloc(size);
|
||||
m = malloc(sizeof(struct rte_vhost_memory) + size);
|
||||
if (!m)
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user