From: Christian Franke <nob...@nowhere.ws>

While the DEFUN should match the list of clients registered in
vtysh, it seems better to handle the case explicitly instead of
relying on the client list and the DEFUN signature being in sync.

Signed-off-by: Christian Franke <ch...@opensourcerouting.org>
---
 vtysh/vtysh.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 63b596a..625ab1c 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1840,6 +1840,9 @@ DEFUN (vtysh_write_terminal_daemon,
        break;
     }
 
+  if (i == array_size(vtysh_client))
+    return CMD_ERR_NO_MATCH;
+
   ret = vtysh_client_execute(&vtysh_client[i], "show running-config\n", 
stdout);
 
   return ret;
-- 
2.8.0


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to