mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-01 04:28:01 +02:00
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
This commit is contained in:
parent
2e9393ffda
commit
8dfe82beb5
2 changed files with 8 additions and 2 deletions
|
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
||||
2003-03-31 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue