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:
parent
f9fbbdf95b
commit
e0d20e6615
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238547
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user