svn commit: r193013 - head/sys/compat/svr4
Xin LI
delphij at FreeBSD.org
Fri May 29 05:51:20 UTC 2009
Author: delphij
Date: Fri May 29 05:51:19 2009
New Revision: 193013
URL: http://svn.freebsd.org/changeset/base/193013
Log:
svr4_sys_getdents64() should not assume that the cookie would exist
everywhere.
PR: kern/91293
Submitted by: "Pedro f. Giffuni" <giffunip asme org>
Obtained from: NetBSD
Modified:
head/sys/compat/svr4/svr4_misc.c
Modified: head/sys/compat/svr4/svr4_misc.c
==============================================================================
--- head/sys/compat/svr4/svr4_misc.c Fri May 29 05:37:27 2009 (r193012)
+++ head/sys/compat/svr4/svr4_misc.c Fri May 29 05:51:19 2009 (r193013)
@@ -487,7 +487,10 @@ again:
reclen = bdp->d_reclen;
if (reclen & 3)
panic("svr4_sys_getdents64: bad reclen");
- off = *cookie++; /* each entry points to the next */
+ if (cookie)
+ off = *cookie++; /* each entry points to the next */
+ else
+ off += reclen;
if ((off >> 32) != 0) {
uprintf("svr4_sys_getdents64: dir offset too large for emulated program");
error = EINVAL;
More information about the svn-src-all
mailing list