www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/12/03/09:05:40

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
From: "Juan Manuel Guerrero" <st001906 AT hrz1 DOT hrz DOT tu-darmstadt DOT de>
Organization: Darmstadt University of Technology
To: djgpp-workers AT delorie DOT com
Date: Fri, 03 Dec 2004 15:04:48 +0200
MIME-Version: 1.0
Subject: Re: A fix for popen()
Message-ID: <41B08090.14778.306B324@localhost>
X-mailer: Pegasus Mail for Windows (v4.02a, DE v4.02 R1)
X-TUD-HRZ-MailScanner: Found to be clean
X-MailScanner-From: st001906 AT hrz1 DOT hrz DOT tu-darmstadt DOT de
Reply-To: djgpp-workers AT delorie DOT com

Please note the following points:
1) I would like to recall your attention to the fact that the *command pointer
issue that makes sed crash is located in popen() and must still be fixed.
2) The popen specific crash of info, reported some days ago by Frank Donahoe,
is generated by a call to free() from pclose() and must be fixed as well.
Here again *command is deallocated without having checked that memory 
has been allocated at all.

The patch below shall *only* show where the difficulties are generated.
It is not a fix.

As soon as this has been fixed and if no one objects I would like to upload
a new release of the djdev204.zip and all the other dj*.zip packages to /beta/v2.
This would it make it easier to me to produce ports compiled for WinXP.

regards,
Juan M. Guerrero


diff -acprNC5 djgpp.orig/src/libc/posix/stdio/popen.c djgpp/src/libc/posix/stdio/popen.c
*** djgpp.orig/src/libc/posix/stdio/popen.c	Tue Nov 30 05:08:20 2004
--- djgpp/src/libc/posix/stdio/popen.c	Fri Dec  3 04:04:06 2004
*************** FILE *popen(const char *cm, const char *
*** 152,161 ****
--- 152,164 ----
  
    return l1->fp;
  
   error:
  
+ /*
+ /* Makes info crash
+ /*
    if (l1->command)
      free(l1->command);
  
    if (temp_name)
      free(temp_name);
*************** int pclose(FILE *pp)
*** 245,254 ****
--- 248,260 ----
      /* invalid mode */
      retval = -1;
  
   exit:
  
+ /*
+ /* Makes sed crash
+ /*
    if (l1->command)
      free(l1->command);
  
    free(l1);
  

- Raw text -


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