Files
qemu/util
Bernhard Beschow f1b1db98cc util/cutils: Fix heap corruption under Windows
Under Windows, QEMU would only sporadically start successfully. In the
G_OS_WIN32 case, get_relocated_path() first determines a cursor
to the end of the "result" string and then increases its size with
g_string_set_size(). Since g_string_set_size() may reallocate, the
cursor may become dangling. Windows may detect this and crash the QEMU
process with the following message:

  HEAP: Free Heap block 000000000499B640 modified at 000000000499B684 after it was freed

Furthermore, QEMU crashes spontaneously, even long after the guest has
booted. For example, it presumably crashes due to the guest setting a
new cursor icon which may be a result of the heap corruption.

Fix this by determining the cursor on the resized string.

Fixes: cf60ccc330 ("cutils: Introduce bundle mechanism")
Cc: qemu-stable@nongnu.org
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-id: 20260414114033.2360-1-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-04-14 15:52:21 +01:00
..
2023-12-19 19:03:38 +01:00
2026-01-22 11:23:31 +00:00
2025-01-16 20:57:17 -08:00
2023-05-23 15:20:15 +08:00
2024-09-20 10:00:27 +03:00
2025-10-01 08:33:24 +02:00
2025-03-10 17:07:16 +08:00
2025-01-29 11:43:04 -03:00
2023-08-31 19:47:43 +02:00
2023-11-15 12:06:05 +03:00
2025-12-27 10:11:12 +01:00
2023-11-03 09:20:31 +01:00