chardev: ensure termios is fully initialized
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 11 Feb 2019 18:24:42 +0000 (18:24 +0000)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 12 Feb 2019 16:35:56 +0000 (17:35 +0100)
valgrind on the test-char.c code reports that 'struct termios' contains
uninitialized memory.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190211182442.8542-17-berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
chardev/char-serial.c

index 3299b4685307f8048c0d78e8f58633c26ecdc1e0..a8bae31b8dda416ffa7984b65d7b5c089978d91b 100644 (file)
@@ -57,7 +57,7 @@ static void qmp_chardev_open_serial(Chardev *chr,
 static void tty_serial_init(int fd, int speed,
                             int parity, int data_bits, int stop_bits)
 {
-    struct termios tty;
+    struct termios tty = {0};
     speed_t spd;
 
 #if 0