aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorMichael R. Hines <mrhines@us.ibm.com>2013-07-22 10:01:52 -0400
committerJuan Quintela <quintela@redhat.com>2013-07-23 11:11:59 +0200
commitde7b685c9e1cf606e37e7116e4c4f03a6ae2d14f (patch)
tree38ede7e31a5c9f2474ec36c29a5c5cc80c97d1d4 /savevm.c
parenta5f56b906e0d7975b87dc3d3c5bfe5a75a4028d2 (diff)
downloadqemu-arm-de7b685c9e1cf606e37e7116e4c4f03a6ae2d14f.tar.gz
rdma: bugfix: ram_control_save_page()
We were not checking for a valid 'bytes_sent' pointer before accessing it. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index e0491e7580..03fc4d93bf 100644
--- a/savevm.c
+++ b/savevm.c
@@ -662,7 +662,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,
offset, size, bytes_sent);
if (ret != RAM_SAVE_CONTROL_DELAYED) {
- if (*bytes_sent > 0) {
+ if (bytes_sent && *bytes_sent > 0) {
qemu_update_position(f, *bytes_sent);
} else if (ret < 0) {
qemu_file_set_error(f, ret);