Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4f2423d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "haven: hh_rm_iface: Avoid integer overflow for multiplication"

parents f3f68f96 501d0efe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ hh_rm_vm_get_hyp_res(hh_vmid_t vmid, u32 *n_entries)

	/* The response payload should contain all the resource entries */
	if (resp_payload_size < sizeof(*n_entries) ||
		(sizeof(*resp_entries) &&
		(resp_payload->n_resource_entries > U32_MAX / sizeof(*resp_entries))) ||
		(sizeof(*n_entries) > (U32_MAX -
		(resp_payload->n_resource_entries * sizeof(*resp_entries)))) ||
		resp_payload_size != sizeof(*n_entries) +