Date: Mon, 10 Sep 2012 16:28:46 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r240322 - stable/9/usr.sbin/lpr/common_source Message-ID: <201209101628.q8AGSk6X082800@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209101628.q8AGSk6X082800>