Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2009 05:51:19 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193013 - head/sys/compat/svr4
Message-ID:  <200905290551.n4T5pJkH061120@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905290551.n4T5pJkH061120>