system/qtest: Fix length parameter in the b64write code
The b64write code has a sanity check that the given lengths matches the real length of the given data, and calculates the minimum of the two values to be on the safe side. However, the address_space_write() then uses the original value and ignores the calculated minimum. Use out_len here to fix the problem. Fixes: 70da30483e7 ("qtest: Use cpu address space instead of system memory") Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Message-ID: <20260518134020.1420932-1-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thomas Huth committed
May 18, 2026 at 15:40 UTC
68af43f1943068bf001afdd1b1983e38ff800624
1 file changed
+1
-1
system/qtest.c
+1
-1
@@ -698,7 +698,7 @@ static void qtest_process_command(CharFrontend *chr, gchar **words)
698
}
699
700
address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, data,
701
- len);
701
+ out_len);
702
703
qtest_send(chr, "OK\n");
704
} else if (strcmp(words[0], "endianness") == 0) {