summaryrefslogtreecommitdiff
path: root/qtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qtest.c b/qtest.c
index 46b99aed52..bd9d417812 100644
--- a/qtest.c
+++ b/qtest.c
@@ -430,6 +430,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
g_assert(words[1] && words[2]);
g_assert(qemu_strtoull(words[1], NULL, 0, &addr) == 0);
g_assert(qemu_strtoull(words[2], NULL, 0, &len) == 0);
+ /* We'd send garbage to libqtest if len is 0 */
+ g_assert(len);
data = g_malloc(len);
cpu_physical_memory_read(addr, data, len);