Report the correct length of the datagram to the kernel to fix strange behavior in the syslog function. --- musl-0.9.9/src/misc/syslog.c +++ src/src/misc/syslog.c @@ -90,9 +90,11 @@ priority, timebuf, log_ident ? log_ident : "", "["+!pid, pid, "]"+!pid); + if (l > sizeof buf) l = sizeof buf - 1; l2 = vsnprintf(buf+l, sizeof buf - l, message, ap); if (l2 >= 0) { l += l2; + if (l > sizeof buf) l = sizeof buf - 1; if (buf[l-1] != '\n') buf[l++] = '\n'; sendto(log_fd, buf, l, 0, (void *)&log_addr, 11); }