This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH] Fix potentially uninitialized variable p
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 8 Jan 2014 09:38:14 -0500
- Subject: Re: [PATCH] Fix potentially uninitialized variable p
- Authentication-results: sourceware.org; auth=none
- References: <CAOYw7dvP64FFXUJS60ixUqj2jr01Dzf3YrchyR79m7AQEb8TKA at mail dot gmail dot com> <20131222071118 dot GB2110 at ednor dot casa dot cgf dot cx> <CAOYw7dt68FHWKmaHwQ5bPoOZTODBAhbVFv5UkoiBbY1-kU6kjQ at mail dot gmail dot com>
- Reply-to: cygwin-patches at cygwin dot com
On Wed, Jan 08, 2014 at 11:00:14AM +0000, Ray Donnelly wrote:
>On Sun, Dec 22, 2013 at 7:11 AM, Christopher Faylor wrote:
>> On Sun, Dec 22, 2013 at 12:40:20AM +0000, Ray Donnelly wrote:
>>>- PWCHAR p;
>>>+ PWCHAR p = NULL;
>> AFAICT, that would result in a NULL dereference. I've checked in
>> a different change to handle this.
>A NULL dereference is maybe more consistent than the random
>dereference that would have otherwise happened.
>I was only trying to ensure -Werror builds succeed.
-Werror is the default for Cygwin. This code has been around for a long
time and the compiler has never complained before. Nevertheless, if the
compiler found a valid issue, making an invalid change to make it shut
up is hardly "more consistent".