diff options
| author | Matthew D Fleming <mdf@FreeBSD.org> | 2010-09-09 18:33:46 +0000 |
|---|---|---|
| committer | Matthew D Fleming <mdf@FreeBSD.org> | 2010-09-09 18:33:46 +0000 |
| commit | dd67e2103ca4ba6b6542a2c69a252f0a26690599 (patch) | |
| tree | fb245e2e8ce30565e64963b84e00c3b93d9bc280 /sys/kern/subr_sbuf.c | |
| parent | 64393db3d1b1e01c6f45afe455767fd8367a4add (diff) | |
Notes
Diffstat (limited to 'sys/kern/subr_sbuf.c')
| -rw-r--r-- | sys/kern/subr_sbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index d7b57a5891a28..58964fb1d85e4 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -305,8 +305,8 @@ sbuf_drain(struct sbuf *s) SBUF_SETFLAG(s, SBUF_OVERFLOWED); return (s->s_error); } - - KASSERT(len > 0, ("Drain must either error or work!")); + KASSERT(len > 0 && len <= s->s_len, + ("Bad drain amount %d for sbuf %p", len, s)); s->s_len -= len; /* * Fast path for the expected case where all the data was |
