Commit 3e3314a8 authored by Vincenzo Maffione's avatar Vincenzo Maffione
Browse files

netmap: fix uint32_t overflow in pool size calculation

MFC after:	1 week
parent 6127ce9d
......@@ -1702,7 +1702,7 @@ _netmap_mem_private_new(size_t size, struct netmap_obj_params *p, int grp_id,
nm_blueprint.pools[i].name,
d->name);
if (checksz) {
uint64_t poolsz = p[i].num * p[i].size;
uint64_t poolsz = (uint64_t)p[i].num * p[i].size;
if (memtotal < poolsz) {
nm_prerr("%s: request too large", d->pools[i].name);
err = ENOMEM;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment