delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/04/03/10:12:31

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: Wed, 3 Apr 2002 10:12:21 -0500
From: Christopher Faylor <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Termcap issue in cygwin
Message-ID: <20020403151221.GI4053@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT CYG DOT 4 DOT 44 DOT 0204030354590 DOT 460-100000 AT MPC96>
Mime-Version: 1.0
In-Reply-To: <Pine.CYG.4.44.0204030354590.460-100000@MPC96>
User-Agent: Mutt/1.3.23.1i

On Wed, Apr 03, 2002 at 04:38:01AM -0800, Eduardo Chappa wrote:
>Hello,
>
> This message has two parts, the long story, and the short story. First
>the short story.
>
>   As far as I understand, the function tgetent, has two parameters, which
>are documented in the manual for termcap(3) and tgetent, the first one is
>of type (char *). According to the manual of the unix system I am using
>the length of this string is supposed to be 1024. I have found that the
>entries for the linux and cygwin terminal are over 1024 characters long,
>which causes this function to corrupt the stack and the program dump core.
>A classical buffer overflow bug. I believe this is an issue with the
>termcap database, which I believe should be shortened to satisfy the 1024
>characters length requirement in (it seems) most (if not all) Unix
>systems.

http://cygwin.com/lists.html#see-above
http://cygwin.com/cgi-bin/htsearch?method=and&sort=thread&restrict=%2Fml%2Fcygwin%2F&words=termcap+1024

>Now the long story (which puts the short story in context).  My real
>goal was to compile Pine for cygwin, which I did, and you are welcome
>to give it a try by downloading it from my web page (address below).
>The problem that I had was that every time that I started Pine in the
>cygwin terminal, it would dump core, due to the problem described
>above.  Pine needed to be executed under rxvt, for example, in order to
>not to make it dump core.  Although I believed for some time that rxvt
>was a requirement in order to execute Pine, now I realize that it is
>not, but my request instead is to make the work around of giving more
>space to the first argument of tgetent disappear.
>
>Is there any chance that both the linux and the cygwin entries will be
>shortened to less than 1024 characters?, or should I just have to
>accept this as a given?

Bottom line: If you want to submit a patch which accomplishes this
shortening without eliminating functionality, please do.

Otherwise, increasing the size of your buffer is the correct solution.

cgf

--
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