From patchwork Fri Mar 15 08:18:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10854271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FD6A1575 for ; Fri, 15 Mar 2019 08:37:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 884302A8B9 for ; Fri, 15 Mar 2019 08:37:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CB0F2A8BE; Fri, 15 Mar 2019 08:37:10 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E66002A8B9 for ; Fri, 15 Mar 2019 08:37:09 +0000 (UTC) Received: from localhost ([127.0.0.1]:51808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4iKz-0003dd-2g for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Mar 2019 04:37:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4iIB-0001LY-6W for qemu-devel@nongnu.org; Fri, 15 Mar 2019 04:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4i3I-0000rn-QA for qemu-devel@nongnu.org; Fri, 15 Mar 2019 04:18:54 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:46954) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4i3I-0000qN-5U for qemu-devel@nongnu.org; Fri, 15 Mar 2019 04:18:52 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5DC9BE02F; Fri, 15 Mar 2019 09:18:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZRUrvbglKdQO; Fri, 15 Mar 2019 09:18:48 +0100 (CET) Received: from function (dhcp-13-99.lip.ens-lyon.fr [140.77.13.99]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E094FDF7B; Fri, 15 Mar 2019 09:18:47 +0100 (CET) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1h4i3D-00015s-Ag; Fri, 15 Mar 2019 09:18:47 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Fri, 15 Mar 2019 09:18:47 +0100 Message-Id: <20190315081847.4116-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PATCH] curses ui: always initialize all curses_line fields 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: Samuel Thibault , kraxel@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP cchar_t can contain not only attr and chars fields, but also ext_color. Initialize the whole structure to zero instead of enumerating fields. Spotted by Coverity: CID 1399711 Signed-off-by: Samuel Thibault Reviewed-by: Peter Maydell --- ui/curses.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index d29098db9f..e99fbe3e24 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -75,9 +75,8 @@ static void curses_update(DisplayChangeListener *dcl, if (vga_to_curses[ch].chars[0]) { curses_line[x] = vga_to_curses[ch]; } else { + curses_line[x] = (cchar_t) {}; curses_line[x].chars[0] = ch; - curses_line[x].chars[1] = 0; - curses_line[x].attr = 0; } curses_line[x].attr |= at; }