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
Tested by:	swills
MFC after:	2 weeks
This commit is contained in:
Jaakko Heinonen 2012-07-17 09:34:52 +00:00
parent f9fbbdf95b
commit e0d20e6615
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238547

View File

@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jobqueue *(*namelist[]))
* 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;