Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/rpc PR/44514: Andrey Simonenko: Buffer underflow in...



details:   https://anonhg.NetBSD.org/src/rev/b1b6664f1825
branches:  trunk
changeset: 761666:b1b6664f1825
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 04 17:38:15 2011 +0000

description:
PR/44514: Andrey Simonenko: Buffer underflow in RPC library for non-blocking
TCP sockets

diffstat:

 lib/libc/rpc/svc_vc.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r f4902d5d78c1 -r b1b6664f1825 lib/libc/rpc/svc_vc.c
--- a/lib/libc/rpc/svc_vc.c     Fri Feb 04 17:36:54 2011 +0000
+++ b/lib/libc/rpc/svc_vc.c     Fri Feb 04 17:38:15 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $     */
+/*     $NetBSD: svc_vc.c,v 1.24 2011/02/04 17:38:15 christos Exp $     */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)svc_tcp.c   2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $");
+__RCSID("$NetBSD: svc_vc.c,v 1.24 2011/02/04 17:38:15 christos Exp $");
 #endif
 #endif
 
@@ -583,7 +583,7 @@
                                cd->strm_stat = XPRT_DIED;
                                return -1;
                        }
-                       if (cd->nonblock && i != cnt) {
+                       if (cd->nonblock) {
                                /*
                                 * For non-blocking connections, do not
                                 * take more than 2 seconds writing the
@@ -597,6 +597,7 @@
                                        return -1;
                                }
                        }
+                       i = 0;
                }
        }
        return len;



Home | Main Index | Thread Index | Old Index