From 654a7a0c299f2f5beca8745a35efd4334f361140 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 3 Feb 2002 02:33:57 +0000 Subject: Update. 2002-02-02 Ulrich Drepper * manual/examples/mkfsock.c (make_named_socket): Make sure name is always NUL-terminated. Patch by Chris D. Sloan . --- manual/examples/mkfsock.c | 1 + 1 file changed, 1 insertion(+) (limited to 'manual') diff --git a/manual/examples/mkfsock.c b/manual/examples/mkfsock.c index affeba6..1ecabb9 100644 --- a/manual/examples/mkfsock.c +++ b/manual/examples/mkfsock.c @@ -23,6 +23,7 @@ make_named_socket (const char *filename) /* Bind a name to the socket. */ name.sun_family = AF_LOCAL; strncpy (name.sun_path, filename, sizeof (name.sun_path)); + name.sun_path[sizeof (name.sun_path) - 1] = '\0'; /* The size of the address is the offset of the start of the filename, -- cgit v1.1