From 54df08e3fac62ce99c39e71c47c9701e02b40317 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 21 Nov 2019 21:44:30 +0700 Subject: libosmovty: properly initialize vty->fd in vty_new() Since we're using talloc_zero(), vty->fd is initialized with 0, which corresponds to stdin. Let's set an invalid value to prevent potential bugs like the one fixed by the recent change [1]. [1] Icdeaea67a06da3a2f07b252e455629559ecc1829 Change-Id: Iec15649781317a23e13d2c2840a8f672050f76c1 --- src/vty/vty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vty/vty.c b/src/vty/vty.c index cd252ad1..8cc2a3ae 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -128,6 +128,7 @@ struct vty *vty_new(void) goto out_obuf; new->max = VTY_BUFSIZ; + new->fd = -1; return new; -- cgit v1.2.3