提交 6048018e 编写于 作者: J John Snow 提交者: Michael Tokarev

ide: remove undefined behavior in ide-test

trivial: initialize the dirty buffer with a random-ish byte.
Stops valgrind from whining about uninitialized buffers.
Signed-off-by: NJohn Snow <jsnow@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 25ac5bbe
...@@ -544,6 +544,7 @@ static void make_dirty(uint8_t device) ...@@ -544,6 +544,7 @@ static void make_dirty(uint8_t device)
guest_buf = guest_alloc(guest_malloc, len); guest_buf = guest_alloc(guest_malloc, len);
buf = g_malloc(len); buf = g_malloc(len);
memset(buf, rand() % 255 + 1, len);
g_assert(guest_buf); g_assert(guest_buf);
g_assert(buf); g_assert(buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册