Date: Tue, 7 Jun 2011 05:04:37 +0000 (UTC) From: "Kenneth D. Merry" <ken@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern subr_prf.c Message-ID: <201106070504.p5754u5m004918@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
ken 2011-06-07 05:04:37 UTC
FreeBSD src repository
Modified files:
sys/kern subr_prf.c
Log:
SVN rev 222804 on 2011-06-07 05:04:37Z by ken
Set pca.p_bufr to NULL when we haven't allocated a buffer.
Otherwise, p_bufr is set to garbage on the stack, and if that garbage
happens to be non-NULL, and the TOLOG or TOCONS flag is set, putbuf()
will get called and attempt to fill the non-existent buffer.
This is really only relevant for tprintf() (and only when the priority is
not -1), but set it in uprintf() and ttyprintf() for completeness.
The next step, to avoid log buffer scrambling, would be to add the
PRINTF_BUFR_SIZE code to tprintf(), but this should prevent panics.
Submitted by: rmacklem
Found by: pho
Revision Changes Path
1.143 +3 -0 src/sys/kern/subr_prf.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106070504.p5754u5m004918>
