diff options
author | Lou Berger <lberger@labn.net> | 2017-05-15 16:34:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-15 16:34:38 +0200 |
commit | 4b34151b88cf4de40b4b070522e378bed895dcb1 (patch) | |
tree | b6dc0fe32a932f1ac9397cc5c1a28e224dc8489a /lib/vty.c | |
parent | doc: fix VARIABLE <> WORD confusion in cli.md (diff) | |
parent | lib: fix access to stack value (diff) | |
download | frr-4b34151b88cf4de40b4b070522e378bed895dcb1.tar.xz frr-4b34151b88cf4de40b4b070522e378bed895dcb1.zip |
Merge pull request #531 from qlyoung/fix-stack-ref
lib: fix access to stack value
Diffstat (limited to 'lib/vty.c')
-rw-r--r-- | lib/vty.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -2633,20 +2633,18 @@ static struct thread_master *vty_master; static void vty_event (enum event event, int sock, struct vty *vty) { - struct thread *vty_serv_thread; - switch (event) { case VTY_SERV: - vty_serv_thread = NULL; - thread_add_read(vty_master, vty_accept, vty, sock, &vty_serv_thread); - vector_set_index (Vvty_serv_thread, sock, vty_serv_thread); + vector_set_index (Vvty_serv_thread, sock, NULL); + thread_add_read(vty_master, vty_accept, vty, sock, + (struct thread **) &Vvty_serv_thread->index[sock]); break; #ifdef VTYSH case VTYSH_SERV: - vty_serv_thread = NULL; - thread_add_read(vty_master, vtysh_accept, vty, sock, &vty_serv_thread); - vector_set_index (Vvty_serv_thread, sock, vty_serv_thread); + vector_set_index (Vvty_serv_thread, sock, NULL); + thread_add_read(vty_master, vtysh_accept, vty, sock, + (struct thread **) &Vvty_serv_thread->index[sock]); break; case VTYSH_READ: vty->t_read = NULL; |