From patchwork Fri Mar 15 13:09:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10854853 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 CB9A01390 for ; Fri, 15 Mar 2019 14:15:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A71D32A92D for ; Fri, 15 Mar 2019 14:15:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B1F72A99F; Fri, 15 Mar 2019 14:15:13 +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 B01242A92D for ; Fri, 15 Mar 2019 14:15:12 +0000 (UTC) Received: from localhost ([127.0.0.1]:55904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4nc7-0003rs-Lj for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Mar 2019 10:15:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4mai-0000a5-NF for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4mah-0003wK-Cs for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:40 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:51308) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4mag-0003tr-GI for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:39 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id CB9A3E139; Fri, 15 Mar 2019 14:09:35 +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 SgIm4B-soarT; Fri, 15 Mar 2019 14:09:34 +0100 (CET) Received: from function (dhcp-64-88.ens-lyon.fr [140.77.64.88]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6F890E142; Fri, 15 Mar 2019 14:09:34 +0100 (CET) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1h4mab-0006nt-IW; Fri, 15 Mar 2019 14:09:33 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Fri, 15 Mar 2019 14:09:32 +0100 Message-Id: <20190315130932.26094-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] [PATCHv2] 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, peter.maydell@linaro.org 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: Philippe Mathieu-Daudé --- ui/curses.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index d29098db9f..cc6d6da684 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -75,9 +75,9 @@ static void curses_update(DisplayChangeListener *dcl, if (vga_to_curses[ch].chars[0]) { curses_line[x] = vga_to_curses[ch]; } else { - curses_line[x].chars[0] = ch; - curses_line[x].chars[1] = 0; - curses_line[x].attr = 0; + curses_line[x] = (cchar_t) { + .chars[0] = ch, + }; } curses_line[x].attr |= at; }