X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:reply-to:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=LIsFWS+0WmyWhdef
	PCuhN9J1IBBVfuzU2Fib3MLwdiEMvDTKZBo2lBIhfSWRySXmwYTelcHPOa8npJh/
	k/+N/6D9NsKomtXVXLC90TKa3BlQscdvZjdensp/zOEjeysaaPzTFSpUXUmlTgSp
	c3jZFqp5Bz8Gnvoz+/JfiAGPwKw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:reply-to:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=Bw9qKeammWO5TfV5qIoybU
	1cEeU=; b=t8yKyhfiKBWSbVdhYA8RA5Mxc2Ag+DIDBQGW2rw7CSio+xUFrUzNnF
	Gz2s++vXAKUiMQguauQPBL79F/SKn5z5wGwa0w49S6pUra3wwP/DuUefZ0YxL6sh
	+9e2hzyypD1qbU6REV1OVq8IPGDzy2RX4eVcOuQ8b47+eYM0vtyuY=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_05,KAM_COUK,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: out.ipsmtp2nec.opaltelecom.net
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2C2AQDTaN9V/9430lUNUa5aAQEBBpkUglMDAgKBcRABAQEBAQEBhS4BAQQjVRELGAICBRYLAgIJAwIBAgFFEwgBAYgUAbIgcYZYiC4IhWwBAQEBBgEBAQEBARyBIoUFhTqFEheCUoFDBZU9jHOaE06EJoM9AQEB
X-IPAS-Result: A2C2AQDTaN9V/9430lUNUa5aAQEBBpkUglMDAgKBcRABAQEBAQEBhS4BAQQjVRELGAICBRYLAgIJAwIBAgFFEwgBAYgUAbIgcYZYiC4IhWwBAQEBBgEBAQEBARyBIoUFhTqFEheCUoFDBZU9jHOaE06EJoM9AQEB
Subject: Re: Updated [test]: coreutils-8.24-2
To: cygwin@cygwin.com
References: <001c01d0e04c$d8ebc210$8ac34630$@bonhard.uklinux.net> <000001d0e051$965f38a0$c31da9e0$@bonhard.uklinux.net> <55DE4B8B.6000401@redhat.com>
Reply-To: cygwin@cygwin.com
From: Sam Edge <cygwin@dwalin.fsnet.co.uk>
X-Enigmail-Draft-Status: N1110
Message-ID: <55DF6961.9040804@dwalin.fsnet.co.uk>
Date: Thu, 27 Aug 2015 20:47:45 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
MIME-Version: 1.0
In-Reply-To: <55DE4B8B.6000401@redhat.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 27/08/2015 00:28, Eric Blake wrote:
> On 08/26/2015 04:50 PM, Fergus wrote:
>>> .. No, you're the first to report it (so 8.24-2 has the same issue), but
>>> now that I know about it, it will get fixed soon.
> Spot the bugs:
>
> int
> cygwin_spelling (char const *path)
> {
> ...
>   int len;
> ...
>   if (! path || ! *path || len > PATH_MAX)
>     /* PATH will cause EINVAL or ENAMETOOLONG, treat it as non-existing.  */
>     return -1;
>   len = strlen (path);
>
>
> D'oh. But this same flub of mine was also present in at least 8.23-4; so
> it was the upstream churn in src/cp.c that caused the stack to be
> different to the point that it now matters.
>
> [For those keeping score, I should use size_t and not int to store
> strlen() values, since it matters on 64-bit when encountering the
> unlikely >2G string; and it helps to never branch on uninitialized memory]
>

One might add, "Always, always initialize automatic variables. This
ensures deterministic behaviour. The compiler will optimise out the
redundant ones."

Rapid diagnosis once reported so I'll let you off this time, Eric. ;-)

-- 
Sam Edge


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

