diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-03-10 04:15:58 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2017-03-10 05:25:11 +0100 |
commit | 9747b9c742de409633d4753bf1a752cbd211e2d3 (patch) | |
tree | cb42f95c6f1cbab00423d853c5b190f1d0e792d5 /log.c | |
parent | upstream commit (diff) | |
download | openssh-9747b9c742de409633d4753bf1a752cbd211e2d3.tar.xz openssh-9747b9c742de409633d4753bf1a752cbd211e2d3.zip |
upstream commit
don't truncate off \r\n from long stderr lines; bz#2688,
reported by Brian Dyson; ok dtucker@
Upstream-ID: cdfdc4ba90639af807397ce996153c88af046ca4
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.48 2016/07/15 05:01:58 dtucker Exp $ */ +/* $OpenBSD: log.c,v 1.49 2017/03/10 03:15:58 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -453,7 +453,8 @@ do_log(LogLevel level, const char *fmt, va_list args) tmp_handler(level, fmtbuf, log_handler_ctx); log_handler = tmp_handler; } else if (log_on_stderr) { - snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); + snprintf(msgbuf, sizeof msgbuf, "%.*s\r\n", + (int)sizeof msgbuf - 3, fmtbuf); (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); } else { #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |