From owner-svn-src-all@FreeBSD.ORG Fri Feb 13 07:47:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6305A79D for ; Fri, 13 Feb 2015 07:47:08 +0000 (UTC) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09BB582F for ; Fri, 13 Feb 2015 07:47:07 +0000 (UTC) Received: by labms9 with SMTP id ms9so8821630lab.10 for ; Thu, 12 Feb 2015 23:47:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=KtQZ5dY+TGbi79Pf1BisU3fXQw+kypXWRQt36r+BzDQ=; b=clpxjv3ulNo2JNQt3AePO02JhREINgQTwo6a1u3vB5OCcKFMJIIxCzOlF+oCx1WAev SuohCpWaKsh5hIzm+kcDf9MfW2IB9o2lsYos3VJVOu8Wsmb+RaGGuAbMMXXGIVsDMQks AsJqojmnhV9p1I7Gx90F+GCQYqoIz/0nFa3KWVi5CsB3DXonVzyfWw37v4WVW5/f9KoU 5uhcaOTXg/W5mEmoZG1M9L6BBT0XFCgv8V2Fik4UJrcjr7V97XVOSQAQrhk4MeYan3nT Ojw8klMH71E6/zROs3iJ4uhVFeWeBhRiA6oYe6U4WeDD1lTCUbrEuEx7w/a4VJcfLvOu euMA== X-Gm-Message-State: ALoCoQlsLZkWvL9SyN1Dp/9/QZmOuIyWjb4KrH+wfMyGAstUTgWS0W2+fQNUaWd49xhRpmJkyZKo X-Received: by 10.112.162.167 with SMTP id yb7mr6617731lbb.76.1423813620208; Thu, 12 Feb 2015 23:47:00 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id i10sm1218905lah.25.2015.02.12.23.46.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 23:46:59 -0800 (PST) Message-ID: <54DDABF2.9000201@freebsd.org> Date: Fri, 13 Feb 2015 10:46:58 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bruce Evans , "Bjoern A. Zeeb" Subject: Re: svn commit: r278634 - head/lib/libc/gen References: <201502122107.t1CL7gaO004041@svn.freebsd.org> <54DD2A87.2050008@FreeBSD.org> <9A683D99-C1E9-4736-982C-69F583D3A40D@FreeBSD.org> <20150213172738.C1007@besplex.bde.org> In-Reply-To: <20150213172738.C1007@besplex.bde.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 07:47:08 -0000 On 13.02.2015 10:18, Bruce Evans wrote: > if (arg > RLIM_INFINITY) > err(...); Checking for RLIM_INFINITY is wrong here, since it is ulong long max, considering arg = va_arg(ap, long); and ulimit(3) stating that arg is always plain long. Proper check will be if (arg < 0) { errno = EINVAL; return (-1); } if (arg > LONG_MAX / 512) arg = LONG_MAX / 512; That all. In pure theoretical case RLIM_INFINITY is less than LONG_MAX, it is job of underlying setrlimit(2) to return error. -- http://ache.vniz.net/