diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-01 00:43:06 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-01 00:43:06 +0000 |
commit | 8dfe82beb530aefce505a9bf915a749647e7183f (patch) | |
tree | 2280ffa66d773953de35316ac5b22d487f1a94bc /dbus/dbus-sysdeps.c | |
parent | 2e9393ffda9630373018e02680fbd204e9f6ac99 (diff) |
2003-03-31 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
(_dbus_listen_unix_socket): fix off-by-one error in null
termination spotted by Nalin
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r-- | dbus/dbus-sysdeps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index f551c4bf..cab970a0 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -346,7 +346,7 @@ _dbus_connect_unix_socket (const char *path, _DBUS_ZERO (addr); addr.sun_family = AF_UNIX; strncpy (addr.sun_path, path, _DBUS_MAX_SUN_PATH_LENGTH); - addr.sun_path[_DBUS_MAX_SUN_PATH_LENGTH] = '\0'; + addr.sun_path[_DBUS_MAX_SUN_PATH_LENGTH-1] = '\0'; if (connect (fd, (struct sockaddr*) &addr, sizeof (addr)) < 0) { @@ -405,7 +405,7 @@ _dbus_listen_unix_socket (const char *path, _DBUS_ZERO (addr); addr.sun_family = AF_UNIX; strncpy (addr.sun_path, path, _DBUS_MAX_SUN_PATH_LENGTH); - addr.sun_path[_DBUS_MAX_SUN_PATH_LENGTH] = '\0'; + addr.sun_path[_DBUS_MAX_SUN_PATH_LENGTH-1] = '\0'; if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) { |