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). Reviewed-by: Andreas Färber <afaer...@suse.de> Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- vmstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vmstate.c b/vmstate.c index e1e9cae..5451fd2 100644 --- a/vmstate.c +++ b/vmstate.c @@ -67,6 +67,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) { -- MST