From owner-svn-src-all@FreeBSD.ORG Tue Jul 17 09:34:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9E1106564A; Tue, 17 Jul 2012 09:34:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D86128FC0C; Tue, 17 Jul 2012 09:34:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6H9Yqde037622; Tue, 17 Jul 2012 09:34:52 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6H9YqWx037620; Tue, 17 Jul 2012 09:34:52 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201207170934.q6H9YqWx037620@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 17 Jul 2012 09:34:52 +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: r238547 - head/usr.sbin/lpr/common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 09:34:53 -0000 Author: jh Date: Tue Jul 17 09:34:52 2012 New Revision: 238547 URL: http://svn.freebsd.org/changeset/base/238547 Log: Make sure that arraysz is initialized to a value larger than zero. arraysz could get initialized to zero on ZFS because ZFS reports directory sizes differently compared to UFS. PR: bin/169493 Tested by: swills MFC after: 2 weeks Modified: head/usr.sbin/lpr/common_source/common.c Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Tue Jul 17 09:31:05 2012 (r238546) +++ head/usr.sbin/lpr/common_source/common.c Tue Jul 17 09:34:52 2012 (r238547) @@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jo * and dividing it by a multiple of the minimum size entry. */ arraysz = (stbuf.st_size / 24); + if (arraysz < 16) + arraysz = 16; queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *)); if (queue == NULL) goto errdone;