Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux/common Fix off by one error in check for si...



details:   https://anonhg.NetBSD.org/src/rev/ac16fb471f21
branches:  trunk
changeset: 526779:ac16fb471f21
user:      tron <tron%NetBSD.org@localhost>
date:      Fri May 10 14:49:38 2002 +0000

description:
Fix off by one error in check for size of field "d_off" in Linux
"dirent" structure.

diffstat:

 sys/compat/linux/common/linux_misc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d107380d6764 -r ac16fb471f21 sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c      Fri May 10 14:38:08 2002 +0000
+++ b/sys/compat/linux/common/linux_misc.c      Fri May 10 14:49:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_misc.c,v 1.108 2002/05/10 14:38:08 tron Exp $    */
+/*     $NetBSD: linux_misc.c,v 1.109 2002/05/10 14:49:38 tron Exp $    */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.108 2002/05/10 14:38:08 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.109 2002/05/10 14:49:38 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -750,7 +750,7 @@
                        idb.d_off = (linux_off_t)linux_reclen;
                        idb.d_reclen = (u_short)bdp->d_namlen;
                } else {
-                       if (sizeof (idb.d_off) < 4 && (off >> 32) != 0) {
+                       if (sizeof (idb.d_off) <= 4 && (off >> 32) != 0) {
                                compat_offseterr(vp, "linux_getdents");
                                error = EINVAL;
                                goto out;



Home | Main Index | Thread Index | Old Index