From de7b685c9e1cf606e37e7116e4c4f03a6ae2d14f Mon Sep 17 00:00:00 2001 From: "Michael R. Hines" Date: Mon, 22 Jul 2013 10:01:52 -0400 Subject: rdma: bugfix: ram_control_save_page() We were not checking for a valid 'bytes_sent' pointer before accessing it. Reviewed-by: Eric Blake Signed-off-by: Michael R. Hines Signed-off-by: Juan Quintela --- savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'savevm.c') 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); -- cgit v1.2.3