2003-07-24 Chip Salzenberg <chip@pobox.com>
+ * support/nfs/xlog.c (xlog): Revise buffer-overflow fix to
+ use Debian security team's cleaner approach.
* debian/control, debian/*.templates, debian/po/*: Upgrade to
po-debconf system for translations of debconf messages.
* debian/changelog: Version 1.0.5-1.
return;
va_start(args, fmt);
- vsnprintf(buff, sizeof (buff) - 2, fmt, args);
+ vsnprintf(buff, sizeof (buff), fmt, args);
va_end(args);
- buff[sizeof (buff) - 2] = 0;
- if ((n = strlen(buff)) > 0 && buff[n-1] != '\n') {
- buff[n++] = '\n'; buff[n++] = '\0';
- }
+ if ((n = strlen(buff)) > 0 && buff[n-1] == '\n')
+ buff[--n] = '\0';
switch (kind) {
case L_FATAL:
tm->tm_year, tm->tm_hour, tm->tm_min,
buff);
#else
- fprintf(log_fp, "%s: %s", log_name, buff);
+ fprintf(log_fp, "%s: %s\n", log_name, buff);
#endif
}
}