|
From: | Alberto Garcia |
Subject: | Re: [Qemu-block] [PATCH v6 4/6] block: convert ThrottleGroup to object with QOM |
Date: | Mon, 21 Aug 2017 14:54:24 +0200 |
User-agent: | Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 21 Aug 2017 11:31:48 AM CEST, Manos Pitsidianakis wrote: > + switch (info->data_type) { > + case UINT64: > + { > + uint64_t *field = (void *)&cfg.buckets[info->type] + > info->offset; > + *field = value; > + } > + break; The rest of the patch looks good, but I still think that these pointer casts here are a bad idea (plus, pointer arithmetic is not allowed on void pointers). If the field ever becomes a 32-bit integer you'd be overwriting someone else's memory. Berto
[Prev in Thread] | Current Thread | [Next in Thread] |