delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/05/17/03:22:54

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Date: Mon, 17 May 1999 11:19:42 +0400
From: Egor Duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.029) S/N A0F2A05A
Reply-To: Egor Duda <deo AT logos-m DOT ru>
Organization: DEO
Message-ID: <9472.990517@logos-m.ru>
To: cygwin-developers <cygwin-developers AT sourceware DOT cygnus DOT com>
Subject: spawn.cc patch
Mime-Version: 1.0

Hi!

the following patch to spawn.cc solves a problem with Configure script
for  perl.  It  runs  meny  scripts  from itself and thus uses linebuf
class  extensively.  In  case,  when  one_line.buf  ==  NULL,  issuing
one_line.prepend  ("  ",1);  makes  buf  to be filled with garbage (no
terminating '\0' and leads to heap corruption.

========================================================================
--- spawn.orig  Thu Apr 01 07:56:55 1999
+++ spawn.cc    Mon May 17 11:11:26 1999
@@ -213,8 +213,8 @@
       buf = (char *) realloc (buf, alloc + 1);
       buf[ix] = '\0';
     }
-  if ((buflen = strlen (buf)))
-      memmove (buf + len, buf, buflen + 1);
+  buflen = strlen (buf);
+  memmove (buf + len, buf, buflen + 1);
   memcpy (buf, what, len);
   ix += len;
 }
========================================================================
Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19


- Raw text -


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