delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/02/10:01:01

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: Thu, 2 Jan 2003 10:01:40 -0500
From: "Pierre A. Humblet" <pierre DOT humblet AT ieee DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: Heads up: *possible* bug in cygwin
Message-ID: <20030102150140.GA388677@WORLDNET>
References: <20030101100510 DOT 5b5b7f3f DOT steven DOT obrien2 AT ntlworld DOT com> <3E137C1C DOT 50804 AT ece DOT gatech DOT edu> <20030102102356 DOT 659c336c DOT steven DOT obrien2 AT ntlworld DOT com>
Mime-Version: 1.0
In-Reply-To: <20030102102356.659c336c.steven.obrien2@ntlworld.com>
User-Agent: Mutt/1.4i

On Thu, Jan 02, 2003 at 10:23:56AM +0000, Steven O'Brien wrote:
> On Wed, 01 Jan 2003 18:39:08 -0500
> Charles Wilson <cwilson AT ece DOT gatech DOT edu> wrote:
> 
> > Steven O'Brien wrote:
> > > My patch works around this problem by allocating a buffer of 1024
> > > bytes for cygwin. I think I got this value by reading the cygwin dll
> > > source to find a real upper bound, but it was a long time ago so
> > > this needs checking. 
There is no enforced limit on the size of the gecos field,  so there is
no guaranteed bound. However 1024 allows for large entries in that field
(300 to 400 bytes) even if all the other fields are at their max.

> > I saw this...it's probably a decent workaround, but hasn't yet been 
> > accepted into current glib source AFAICT --- glib-2.2.0 still uses a
> > 64 byte buffer for reading pw entries.  But that's not where the
> > segfault is happening in my case (as my earlier message showed).
> 
> Just to be clear, I did not see any failure in this function either. But
> failures later (in gnome-vfs I think) were due to memory corruption
> which went away when I increased this buffer to 1024 bytes.

Cygwin won't overrun the buffer but returns an error if it's too short.
So if increasing the buffer length makes a difference, error handling
becomes suspect.

Pierre

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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