ensure unix socket paths are NUL-terminated for bind/connect

The unix(7) man page recommends that sun_path is NUL-terminated
when struct sockaddr_un is passed to a bind() or connect() call.
Non-NUL-terminated paths only need to be dealt with at the
receiving end of a UNIX domain socket.

Commit b24efa5 erroneously assumed otherwise.

Change-Id: I9beecfa500db75cb679b1edcc352c893bf098b13
Fixes: b24efa551dc91e177c5cb8da674e9f8432d52dc9
Related: OS#2673
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 @@
 	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;
 	}