From patchwork Tue Feb 28 06:44:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 9594799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32C6160453 for ; Tue, 28 Feb 2017 06:50:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23949284D5 for ; Tue, 28 Feb 2017 06:50:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17FF1284DE; Tue, 28 Feb 2017 06:50:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A6BFE284D5 for ; Tue, 28 Feb 2017 06:50:25 +0000 (UTC) Received: from localhost ([::1]:58964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibc8-00050P-Rm for patchwork-qemu-devel@patchwork.kernel.org; Tue, 28 Feb 2017 01:50:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibX1-0001oJ-Ld for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cibWy-0003E2-KY for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:45:07 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:39219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibWy-0003DW-CM; Tue, 28 Feb 2017 01:45:04 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B611643588; Tue, 28 Feb 2017 09:45:00 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 208483D0; Tue, 28 Feb 2017 09:45:00 +0300 (MSK) Received: (nullmailer pid 19627 invoked by uid 1000); Tue, 28 Feb 2017 06:44:59 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 09:44:49 +0300 Message-Id: <6048018ef6112476b529807ad603015314151bb2.1488264243.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 06/14] ide: remove undefined behavior in ide-test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: John Snow trivial: initialize the dirty buffer with a random-ish byte. Stops valgrind from whining about uninitialized buffers. Signed-off-by: John Snow Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- tests/ide-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index fb541f8..b57c2b1 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -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);