Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2012 14:55:22 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r241099 - stable/8/usr.sbin/lpr/common_source
Message-ID:  <201210011455.q91EtMn0065955@svn.freebsd.org>

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



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