diff options
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -151,7 +151,7 @@ static int log_open_syslog(void) { goto fail; } - if (connect(syslog_fd, &sa.sa, sizeof(sa)) < 0) { + if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) { close_nointr_nofail(syslog_fd); /* Some legacy syslog systems still use stream @@ -163,7 +163,7 @@ static int log_open_syslog(void) { goto fail; } - if (connect(syslog_fd, &sa.sa, sizeof(sa)) < 0) { + if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) { r = -errno; goto fail; } |