From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53736 invoked by alias); 27 Aug 2015 19:47:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 53724 invoked by uid 89); 27 Aug 2015 19:47:49 -0000 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 Received: from out.ipsmtp2nec.opaltelecom.net (HELO out.ipsmtp2nec.opaltelecom.net) (62.24.202.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 27 Aug 2015 19:47:47 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C2AQDTaN9V/9430lUNUa5aAQEBBpkUglMDAgKBcRABAQEBAQEBhS4BAQQjVRELGAICBRYLAgIJAwIBAgFFEwgBAYgUAbIgcYZYiC4IhWwBAQEBBgEBAQEBARyBIoUFhTqFEheCUoFDBZU9jHOaE06EJoM9AQEB X-IPAS-Result: A2C2AQDTaN9V/9430lUNUa5aAQEBBpkUglMDAgKBcRABAQEBAQEBhS4BAQQjVRELGAICBRYLAgIJAwIBAgFFEwgBAYgUAbIgcYZYiC4IhWwBAQEBBgEBAQEBARyBIoUFhTqFEheCUoFDBZU9jHOaE06EJoM9AQEB Received: from 85-210-55-222.dynamic.dsl.as9105.com (HELO [192.168.15.105]) ([85.210.55.222]) by out.ipsmtp2nec.opaltelecom.net with ESMTP; 27 Aug 2015 20:47:43 +0100 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 X-Enigmail-Draft-Status: N1110 Message-ID: <55DF6961.9040804@dwalin.fsnet.co.uk> Date: Thu, 27 Aug 2015 20:26:00 -0000 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 X-SW-Source: 2015-08/txt/msg00491.txt.bz2 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