From cbd45b6c66f38050c9208e0d1ce5dfe133d5a555 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 22 Jan 2002 11:22:55 +0000 Subject: In certain cases sbuf_printf() and sbuf_vprintf() could mistakely make extendable sbufs as overflowed. Approved by: des --- sys/kern/subr_sbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern/subr_sbuf.c') diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index 4bf4063..96d5078 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -426,7 +426,7 @@ sbuf_vprintf(struct sbuf *s, const char *fmt, va_list ap) * given sufficient space, hence the min() calculation below. */ s->s_len += min(len, SBUF_FREESPACE(s)); - if (!SBUF_HASROOM(s)) + if (!SBUF_HASROOM(s) && !SBUF_CANEXTEND(s)) SBUF_SETFLAG(s, SBUF_OVERFLOWED); KASSERT(s->s_len < s->s_size, -- cgit v1.1