[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/5] curses ui: always initialize all curses_line fie
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 2/5] curses ui: always initialize all curses_line fields |
Date: |
Mon, 18 Mar 2019 12:20:35 +0100 |
From: Samuel Thibault <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/curses.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/curses.c b/ui/curses.c
index 3a7e8649f3de..4ef9b9c677ce 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;
}
--
2.18.1
- [Qemu-devel] [PULL 0/5] Ui 20190318 patches, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 2/5] curses ui: always initialize all curses_line fields,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 4/5] keymaps: use nodeadkeys variant for de and fr, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 3/5] curses ui: add missing iconv_close calls, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 1/5] vnc: fix unalignment access in tight_pack24, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 5/5] keymaps: regenerate keymaps, Gerd Hoffmann, 2019/03/18
- Re: [Qemu-devel] [PULL 0/5] Ui 20190318 patches, Peter Maydell, 2019/03/18