delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/14/13:15:07

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 14 Jul 2004 19:15:03 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs
Message-ID: <20040714171503.GX1389@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 58 DOT 0407132313330 DOT 29800 AT slinky DOT cs DOT nyu DOT edu> <NUTMEG8VD8o8HKHT0cW000008a4 AT NUTMEG DOT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
In-Reply-To: <NUTMEG8VD8o8HKHT0cW000008a4@NUTMEG.CAM.ARTIMI.COM>
User-Agent: Mutt/1.4.2i

On Jul 14 17:58, Dave Korn wrote:
> > -----Original Message-----
> > From: cygwin-owner On Behalf Of Igor Pechtchanski
> > Sent: 14 July 2004 04:22
> 
> > Ok, the theory washed out.  The code above is actually simply 
> > buggy.  When
> > RegQueryValueEx is called (2 lines below the arrow), the 
> > "size" parameter
> > is uninitialized, so, in effect, it keeps thinking that the buffer has
> > some random size and reallocating (which, of course, doesn't 
> > change the
> > size, hence the infinite loop).
> 
>   I concur; that is bad code.  The variable unambiguously needs
> initialising, and since RegQueryValueEx damages it, it needs to be re-set
> each time round the loop.  
> [...]

I'm wondering if that isn't mildly OT here.  Shouldn't that be discussed
on cygwin-developers in a perfect world?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019