# HG changeset patch # User Richard M. Stallman # Date 908054422 0 # Node ID 2ce0e36402ff3ae245149fe2cf32c847bac19f2d # Parent 879b88bb7ab2efa8c3bd0e83780c6bb08b76cb19 (main): Null-terminate system_name. diff -r 879b88bb7ab2 -r 2ce0e36402ff lib-src/emacsclient.c --- a/lib-src/emacsclient.c Sat Oct 10 15:07:08 1998 +0000 +++ b/lib-src/emacsclient.c Sat Oct 10 21:20:22 1998 +0000 @@ -225,6 +225,8 @@ struct stat statbfr; gethostname (system_name, sizeof (system_name)); + /* system_name must be null-terminated string */ + system_name[sizeof (system_name) - 1] = '\0'; sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); if (stat (server.sun_path, &statbfr) == -1) diff -r 879b88bb7ab2 -r 2ce0e36402ff lib-src/emacsserver.c --- a/lib-src/emacsserver.c Sat Oct 10 15:07:08 1998 +0000 +++ b/lib-src/emacsserver.c Sat Oct 10 21:20:22 1998 +0000 @@ -251,6 +251,8 @@ server.sun_family = AF_UNIX; #ifndef SERVER_HOME_DIR gethostname (system_name, sizeof (system_name)); + /* system_name must be null-terminated string */ + system_name[sizeof (system_name) - 1] = '\0'; sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); if (unlink (server.sun_path) == -1 && errno != ENOENT)