Okay, this time I'll even include the entire patch...
-- Danny J. Zerkel
[EMAIL PROTECTED]
--- svr4_stream.c.orig Thu Aug 31 18:54:05 2000
+++ svr4_stream.c Wed Nov 22 22:39:00 2000
@@ -162,7 +162,7 @@
struct uio ktruio;
#endif
- error = getsock(p->p_fd, s, &fp);
+ error = holdsock(p->p_fd, s, &fp);
if (error)
return (error);
auio.uio_iov = mp->msg_iov;
@@ -174,13 +174,17 @@
auio.uio_resid = 0;
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0)
+ if ((auio.uio_resid += iov->iov_len) < 0) {
+ fdrop(fp, p);
return (EINVAL);
+ }
}
if (mp->msg_name) {
error = getsockaddr(&to, mp->msg_name, mp->msg_namelen);
- if (error)
+ if (error) {
+ fdrop(fp, p);
return (error);
+ }
} else
to = 0;
if (mp->msg_control) {
@@ -229,6 +233,7 @@
bad:
if (to)
FREE(to, M_SONAME);
+ fdrop(fp, p);
return (error);
}
@@ -253,7 +258,7 @@
struct uio ktruio;
#endif
- error = getsock(p->p_fd, s, &fp);
+ error = holdsock(p->p_fd, s, &fp);
if (error)
return (error);
auio.uio_iov = mp->msg_iov;
@@ -265,8 +270,10 @@
auio.uio_resid = 0;
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
- if ((auio.uio_resid += iov->iov_len) < 0)
+ if ((auio.uio_resid += iov->iov_len) < 0) {
+ fdrop(fp, p);
return (EINVAL);
+ }
}
#ifdef KTRACE
if (KTRPOINT(p, KTR_GENIO)) {
@@ -352,6 +359,7 @@
FREE(fromsa, M_SONAME);
if (control)
m_freem(control);
+ fdrop(fp, p);
return (error);
}
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message