svn commit: r241099 - stable/8/usr.sbin/lpr/common_source

Jaakko Heinonen jh at FreeBSD.org
Mon Oct 1 14:55:23 UTC 2012


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;


More information about the svn-src-all mailing list