diff options
Diffstat (limited to 'src/e1_input_vty.c')
-rw-r--r-- | src/e1_input_vty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c index 653c573..d81c859 100644 --- a/src/e1_input_vty.c +++ b/src/e1_input_vty.c @@ -101,10 +101,10 @@ DEFUN(cfg_e1line_socket, cfg_e1_line_socket_cmd, int e1_nr = atoi(argv[0]); struct sockaddr_un sun; - /* Don't exceed the maximum unix socket path length. See the unix(7) man page.*/ - if (strlen(argv[1]) > sizeof(sun.sun_path)) { + /* Don't exceed the maximum unix socket path length, including a NUL byte. See the unix(7) man page.*/ + if (strlen(argv[1]) > sizeof(sun.sun_path) - 1) { vty_out(vty, "%% Socket path length exceeds %zd bytes: '%s'%s", - sizeof(sun.sun_path), argv[1], VTY_NEWLINE); + sizeof(sun.sun_path) - 1, argv[1], VTY_NEWLINE); return CMD_WARNING; } |