From owner-svn-src-head@FreeBSD.ORG Fri May 29 05:51:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19783106566B; Fri, 29 May 2009 05:51:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07FD78FC0A; Fri, 29 May 2009 05:51:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4T5pJYN061121; Fri, 29 May 2009 05:51:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4T5pJkH061120; Fri, 29 May 2009 05:51:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905290551.n4T5pJkH061120@svn.freebsd.org> From: Xin LI Date: Fri, 29 May 2009 05:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193013 - head/sys/compat/svr4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 05:51:20 -0000 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" 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;