[Midnightbsd-cvs] src [8045] trunk/usr.sbin/lpr/common_source/common.c: make sure the arraysz is init to a value largert than zero.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 15 16:56:12 EDT 2016


Revision: 8045
          http://svnweb.midnightbsd.org/src/?rev=8045
Author:   laffer1
Date:     2016-09-15 16:56:12 -0400 (Thu, 15 Sep 2016)
Log Message:
-----------
make sure the arraysz is init to a value largert than zero.

Modified Paths:
--------------
    trunk/usr.sbin/lpr/common_source/common.c

Modified: trunk/usr.sbin/lpr/common_source/common.c
===================================================================
--- trunk/usr.sbin/lpr/common_source/common.c	2016-09-15 20:55:21 UTC (rev 8044)
+++ trunk/usr.sbin/lpr/common_source/common.c	2016-09-15 20:56:12 UTC (rev 8045)
@@ -139,6 +139,8 @@
 	 * 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 Midnightbsd-cvs mailing list