]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ide: remove undefined behavior in ide-test
authorJohn Snow <jsnow@redhat.com>
Wed, 8 Feb 2017 17:05:33 +0000 (12:05 -0500)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 28 Feb 2017 06:03:38 +0000 (09:03 +0300)
trivial: initialize the dirty buffer with a random-ish byte.
Stops valgrind from whining about uninitialized buffers.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
tests/ide-test.c

index fb541f88b5f69b3fdf0ed5848ad2d8d4c530a629..b57c2b1676de8d9687e46b1c695ef17e0bd62ba6 100644 (file)
@@ -544,6 +544,7 @@ static void make_dirty(uint8_t device)
 
     guest_buf = guest_alloc(guest_malloc, len);
     buf = g_malloc(len);
+    memset(buf, rand() % 255 + 1, len);
     g_assert(guest_buf);
     g_assert(buf);