From dev-return-20879-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Sun Jul 27 23:53:20 2008 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 55598 invoked from network); 27 Jul 2008 23:53:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2008 23:53:20 -0000 Received: (qmail 73199 invoked by uid 500); 27 Jul 2008 23:53:18 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 73137 invoked by uid 500); 27 Jul 2008 23:53:18 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 73126 invoked by uid 99); 27 Jul 2008 23:53:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Jul 2008 16:53:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bojan@rexursive.com designates 203.171.74.242 as permitted sender) Received: from [203.171.74.242] (HELO beauty.rexursive.com) (203.171.74.242) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Jul 2008 23:52:24 +0000 Received: from [10.1.120.24] (shrek.rexursive.com [10.1.120.24]) by beauty.rexursive.com (Postfix) with ESMTP id 2DDF4407AA for ; Mon, 28 Jul 2008 09:52:18 +1000 (EST) Subject: Resource list limits From: Bojan Smojver To: APR Development List Content-Type: multipart/mixed; boundary="=-uh1PWDRaCliKxfqNQ38s" Date: Mon, 28 Jul 2008 09:52:17 +1000 Message-Id: <1217202737.2812.2.camel@shrek.rexursive.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) X-Virus-Checked: Checked by ClamAV on apache.org --=-uh1PWDRaCliKxfqNQ38s Content-Type: text/plain Content-Transfer-Encoding: 7bit I think we should be a little bit more strict when it comes to resource limits in reslist code. As per attached, it should not be possible to set min to less than zero and hmax to zero, as both don't make sense. Comments? -- Bojan --=-uh1PWDRaCliKxfqNQ38s Content-Disposition: attachment; filename=apr-reslist_limits.patch Content-Type: text/x-patch; name=apr-reslist_limits.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: misc/apr_reslist.c =================================================================== --- misc/apr_reslist.c (revision 680207) +++ misc/apr_reslist.c (working copy) @@ -245,7 +245,8 @@ /* Do some sanity checks so we don't thrash around in the * maintenance routine later. */ - if (min > smax || min > hmax || smax > hmax || ttl < 0) { + if (min < 0 || min > smax || min > hmax || smax > hmax || hmax == 0 || + ttl < 0) { return APR_EINVAL; } --=-uh1PWDRaCliKxfqNQ38s--