From nobody Fri Apr 19 03:08:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552639044439905.1229898938258; Fri, 15 Mar 2019 01:37:24 -0700 (PDT) Received: from localhost ([127.0.0.1]:51808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4iLB-0003dd-H3 for importer@patchew.org; Fri, 15 Mar 2019 04:37:21 -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) 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 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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] =3D vga_to_curses[ch]; } else { + curses_line[x] =3D (cchar_t) {}; curses_line[x].chars[0] =3D ch; - curses_line[x].chars[1] =3D 0; - curses_line[x].attr =3D 0; } curses_line[x].attr |=3D at; } --=20 2.20.1