diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-11-21 21:44:30 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2019-11-30 18:49:33 +0000 |
commit | 54df08e3fac62ce99c39e71c47c9701e02b40317 (patch) | |
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
-rw-r--r-- | src/vty/vty.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |