summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_sbuf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-01-22 11:22:55 +0000
committerphk <phk@FreeBSD.org>2002-01-22 11:22:55 +0000
commitcbd45b6c66f38050c9208e0d1ce5dfe133d5a555 (patch)
tree08dced56e850793fea949b56ae5172c83fa8f1b1 /sys/kern/subr_sbuf.c
parent069b88ab0ab3581efc6b033142f499f34167c65c (diff)
downloadFreeBSD-src-cbd45b6c66f38050c9208e0d1ce5dfe133d5a555.zip
FreeBSD-src-cbd45b6c66f38050c9208e0d1ce5dfe133d5a555.tar.gz
In certain cases sbuf_printf() and sbuf_vprintf() could mistakely
make extendable sbufs as overflowed. Approved by: des
Diffstat (limited to 'sys/kern/subr_sbuf.c')
-rw-r--r--sys/kern/subr_sbuf.c2
1 files changed, 1 insertions, 1 deletions
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,
OpenPOWER on IntegriCloud