commit | 54df08e3fac62ce99c39e71c47c9701e02b40317 | [log] [tgz] |
---|---|---|
author | Vadim Yanitskiy <axilirator@gmail.com> | Thu Nov 21 21:44:30 2019 +0700 |
committer | laforge <laforge@osmocom.org> | Sat Nov 30 18:49:33 2019 +0000 |
tree | 452ac57da7fc5edd57dc3f20c3ba171b5183a72c | |
parent | a3e9ef9289350076f124254d1b70285f7d439559 [diff] |
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
diff --git a/src/vty/vty.c b/src/vty/vty.c index cd252ad..8cc2a3a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c
@@ -128,6 +128,7 @@ goto out_obuf; new->max = VTY_BUFSIZ; + new->fd = -1; return new;