All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Kiryanov <rkir@google.com>
To: peterx@redhat.com
Cc: qemu-devel@nongnu.org, whollins@google.com, jansene@google.com,
	 jpcottin@google.com, Roman Kiryanov <rkir@google.com>
Subject: [PATCH] vmstate: assert that VMStateDescription::fields is not NULL
Date: Mon,  9 Mar 2026 22:31:16 +0000	[thread overview]
Message-ID: <20260309223116.3233668-1-rkir@google.com> (raw)

The vmstate_save_state_v() function does not
support NULL in VMStateDescription::fields
and will crash if one is provided.

Signed-off-by: Roman Kiryanov <rkir@google.com>
---
 migration/vmstate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/migration/vmstate.c b/migration/vmstate.c
index 4d28364f7b..5cb173ea25 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -433,6 +433,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
     ERRP_GUARD();
     int ret = 0;
     const VMStateField *field = vmsd->fields;
+    assert(field);
 
     trace_vmstate_save_state_top(vmsd->name);
 
-- 
2.53.0.851.ga537e3e6e9-goog



             reply	other threads:[~2026-03-09 22:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 22:31 Roman Kiryanov [this message]
2026-03-10 16:31 ` [PATCH] vmstate: assert that VMStateDescription::fields is not NULL Peter Xu
2026-03-10 18:44   ` Fabiano Rosas
2026-03-12 20:42     ` Roman Kiryanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260309223116.3233668-1-rkir@google.com \
    --to=rkir@google.com \
    --cc=jansene@google.com \
    --cc=jpcottin@google.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=whollins@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.