In certain cases sbuf_printf() and sbuf_vprintf() could mistakely
make extendable sbufs as overflowed. Approved by: des
This commit is contained in:
parent
7109d65231
commit
1a25c86b3b
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user