]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virsh: fix broken code in freepages
authorEric Blake <eblake@redhat.com>
Thu, 19 Jun 2014 15:21:08 +0000 (09:21 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 19 Jun 2014 15:21:08 +0000 (09:21 -0600)
commit404bac14abd7c86c5c16851643a5b0c192f35f6a
tree52dfd286dab89afcfbe2f6aa347e009dc56ebac9
parenta341fc731dd4066eb52a2c0708813d9f4022fa40
virsh: fix broken code in freepages

Commit 9e3efe53 broke the build under valgrind or clang, by writing
8 bytes through an allocation of 4 bytes.  It also risks multiplication
overflow when mallocing (that's a pervasive problem that needs an
audit in the rest of the code, but we might as well fix this one while
we are here), and had a typo.

* tools/virsh-host.c (cmdFreepages): Avoid integer overflow and
undefined behavior.

Signed-off-by: Eric Blake <eblake@redhat.com>
tools/virsh-host.c