From owner-svn-src-stable-9@FreeBSD.ORG Mon Sep 10 16:28:46 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969001065673; Mon, 10 Sep 2012 16:28:46 +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 81AD18FC0C; Mon, 10 Sep 2012 16:28:46 +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 q8AGSksw082802; Mon, 10 Sep 2012 16:28:46 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8AGSk6X082800; Mon, 10 Sep 2012 16:28:46 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201209101628.q8AGSk6X082800@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 10 Sep 2012 16:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240322 - stable/9/usr.sbin/lpr/common_source X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 16:28:46 -0000 Author: jh Date: Mon Sep 10 16:28:45 2012 New Revision: 240322 URL: http://svn.freebsd.org/changeset/base/240322 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/9/usr.sbin/lpr/common_source/common.c Directory Properties: stable/9/usr.sbin/lpr/ (props changed) stable/9/usr.sbin/lpr/filters/ (props changed) stable/9/usr.sbin/lpr/lpd/ (props changed) Modified: stable/9/usr.sbin/lpr/common_source/common.c ============================================================================== --- stable/9/usr.sbin/lpr/common_source/common.c Mon Sep 10 16:27:19 2012 (r240321) +++ stable/9/usr.sbin/lpr/common_source/common.c Mon Sep 10 16:28:45 2012 (r240322) @@ -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;