diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-18 11:16:34 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-18 11:16:34 +0000 |
commit | 454f0b2cfcf50c1ac081b8b1fad60e632b818161 (patch) | |
tree | 01d6271c4f09d39d3376454dc8f54e142d5dc552 | |
parent | 4ac4e54d7aeca8f95a01bdd8c492e789c7000d7c (diff) |
Be sure to initalized and use the "len" variable correctly in iestart();
from Thierry Herbelot (%thierry% at herbelot ding com).
-rw-r--r-- | sys/dev/isa/if_ie.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c index b5ccc4f1fdb..889c51a4fc3 100644 --- a/sys/dev/isa/if_ie.c +++ b/sys/dev/isa/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.28 2004/05/12 06:35:11 tedu Exp $ */ +/* $OpenBSD: if_ie.c,v 1.29 2004/05/18 11:16:33 miod Exp $ */ /* $NetBSD: if_ie.c,v 1.51 1996/05/12 23:52:48 mycroft Exp $ */ /*- @@ -1501,11 +1501,17 @@ iestart(ifp) sc->xchead); #endif + len = 0; buffer = sc->xmit_cbuffs[sc->xchead]; - for (m = m0; m != 0; m = m->m_next) { + + for (m = m0; m != NULL && (len + m->m_len) < IE_TBUF_SIZE; + m = m->m_next) { bcopy(mtod(m, caddr_t), buffer, m->m_len); buffer += m->m_len; + len += m->m_len; } + if (m != NULL) + printf("%s: tbuf overflow\n", sc->sc_dev.dv_xname); m_freem(m0); |