diff options
author | jmg <jmg@FreeBSD.org> | 1999-07-23 20:08:27 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 1999-07-23 20:08:27 +0000 |
commit | aa93e6cc7f601a09a6bd74505988524619e53948 (patch) | |
tree | 1df62ffad2bbe2c427803cebc4cef1c1890f1a6d /sys/net/if_tun.c | |
parent | e4620300d62667d571e600e6ecb2f9612cd79c16 (diff) | |
download | FreeBSD-src-aa93e6cc7f601a09a6bd74505988524619e53948.zip FreeBSD-src-aa93e6cc7f601a09a6bd74505988524619e53948.tar.gz |
fix a problem w/ zero byte writes to the tunnel device. It would bypass
the loop and not set an error, so we would then try to access an invalid
mbuf...
PR: 12780
Submitted by: bright@rush.net aka zb^3
a new record in length a pr was open... only about a half hour...
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 4d1d2cc..6e8c479 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -590,7 +590,7 @@ tunwrite(dev, uio, flag) TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); - if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) { + if (uio->uio_resid <= 0 || uio->uio_resid > TUNMRU) { TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit, uio->uio_resid); return EIO; |