Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/compat/osf1 Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/1bc93ae6a5b9
branches:  netbsd-6
changeset: 776694:1bc93ae6a5b9
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Aug 27 15:01:08 2014 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1141):
        sys/compat/osf1/osf1_file.c: revision 1.42
Ensure nbytes > 0. Otherwise bad things may happen.
Compile-tested only.
ok christos@

diffstat:

 sys/compat/osf1/osf1_file.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 8463581fc273 -r 1bc93ae6a5b9 sys/compat/osf1/osf1_file.c
--- a/sys/compat/osf1/osf1_file.c       Wed Aug 27 14:53:26 2014 +0000
+++ b/sys/compat/osf1/osf1_file.c       Wed Aug 27 15:01:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_file.c,v 1.41 2011/07/22 10:02:08 njoly Exp $ */
+/* $NetBSD: osf1_file.c,v 1.41.8.1 2014/08/27 15:01:08 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: osf1_file.c,v 1.41 2011/07/22 10:02:08 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_file.c,v 1.41.8.1 2014/08/27 15:01:08 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
@@ -133,7 +133,7 @@
        /* {
                syscallarg(int) fd;
                syscallarg(char *) buf;
-               syscallarg(u_int) nbytes;
+               syscallarg(int) nbytes;
                syscallarg(long *) basep;
        } */
        struct dirent *bdp;
@@ -151,6 +151,11 @@
        off_t *cookiebuf = NULL, *cookie;
        int ncookies, fd;
 
+       if (SCARG(uap, nbytes) < 0)
+               return EINVAL;
+       if (SCARG(uap, nbytes) == 0)
+               return 0;
+
        fd = SCARG(uap, fd);
        if ((error = fd_getvnode(fd, &fp)) != 0)
                return (error);



Home | Main Index | Thread Index | Old Index