svn commit: r240322 - stable/9/usr.sbin/lpr/common_source
Jaakko Heinonen
jh at FreeBSD.org
Mon Sep 10 16:28:46 UTC 2012
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;
More information about the svn-src-stable
mailing list