From owner-svn-src-stable@FreeBSD.ORG Mon Oct 1 14:55:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0684910656B2; Mon, 1 Oct 2012 14:55:23 +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 E465C8FC0C; Mon, 1 Oct 2012 14:55:22 +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 q91EtMhw065957; Mon, 1 Oct 2012 14:55:22 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q91EtMn0065955; Mon, 1 Oct 2012 14:55:22 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201210011455.q91EtMn0065955@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 1 Oct 2012 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241099 - stable/8/usr.sbin/lpr/common_source X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2012 14:55:23 -0000 Author: jh Date: Mon Oct 1 14:55:22 2012 New Revision: 241099 URL: http://svn.freebsd.org/changeset/base/241099 Log: MFC r238547: 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 Modified: stable/8/usr.sbin/lpr/common_source/common.c Directory Properties: stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lpr/lpd/ (props changed) Modified: stable/8/usr.sbin/lpr/common_source/common.c ============================================================================== --- stable/8/usr.sbin/lpr/common_source/common.c Mon Oct 1 14:52:34 2012 (r241098) +++ stable/8/usr.sbin/lpr/common_source/common.c Mon Oct 1 14:55:22 2012 (r241099) @@ -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;