Module Name:    src
Committed By:   sborrill
Date:           Sun Oct 11 18:03:22 UTC 2009

Modified Files:
        src/sys/kern [netbsd-5]: tty.c

Log Message:
Pull up the following revisions(s) (requested by dsl in ticket #1087):
        sys/kern/tty.c: revision 1.234

Check for zero length read here - and return zero. Without this there is a
simple local-user panic in ureadc().


To generate a diff of this commit:
cvs rdiff -u -r1.227.4.1 -r1.227.4.2 src/sys/kern/tty.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/tty.c
diff -u src/sys/kern/tty.c:1.227.4.1 src/sys/kern/tty.c:1.227.4.2
--- src/sys/kern/tty.c:1.227.4.1	Fri Feb  6 02:05:18 2009
+++ src/sys/kern/tty.c	Sun Oct 11 18:03:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.227.4.1 2009/02/06 02:05:18 snj Exp $	*/
+/*	$NetBSD: tty.c,v 1.227.4.2 2009/10/11 18:03:21 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.227.4.1 2009/02/06 02:05:18 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.227.4.2 2009/10/11 18:03:21 sborrill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1655,6 +1655,9 @@
 	long		lflag, slp;
 	struct timeval	now, stime;
 
+	if (uio->uio_resid == 0)
+		return 0;
+
 	stime.tv_usec = 0;	/* XXX gcc */
 	stime.tv_sec = 0;	/* XXX gcc */
 

Reply via email to