Message ID | 1386087086-3691-24-git-send-email-mst@redhat.com |
---|---|
State | New |
Headers | show |
Am 03.12.2013 17:29, schrieb Michael S. Tsirkin: > savevm will segfault if version_id < vmsd->minimum_version_id && > version_id >= vmsd->minimum_version_id_old > > This calls through a NULL pointer. This is a bug (should > exit not crash). > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Andreas
diff --git a/savevm.c b/savevm.c index 3f912dd..04349f6 100644 --- a/savevm.c +++ b/savevm.c @@ -1686,6 +1686,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, return -EINVAL; } if (version_id < vmsd->minimum_version_id) { + if (!vmsd->load_state_old) { + return -EINVAL; + } return vmsd->load_state_old(f, opaque, version_id); } if (vmsd->pre_load) {
savevm will segfault if version_id < vmsd->minimum_version_id && version_id >= vmsd->minimum_version_id_old This calls through a NULL pointer. This is a bug (should exit not crash). Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- savevm.c | 3 +++ 1 file changed, 3 insertions(+)