delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/04/24/16:00:04

From: k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at (Oberhumer Markus)
Message-Id: <199604241807.UAA05574@c210.edvz.uni-linz.ac.at>
Subject: 2 little patches & bug reports
To: djgpp-workers AT delorie DOT com
Date: Wed, 24 Apr 1996 20:07:28 -0200 (MET DST)
Return-Read-To: markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at

===============================================================================
Markus F.X.J. Oberhumer <markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at>

Subject: 2 little patches & bug reports
To: djgpp-workers AT delorie DOT com
===============================================================================

Hello workers,

I'm sending you 2 rather trivial patches and 2 bug reports.
Hope you find them useful.

Best regards,
  Markus


P.S. Could someone kindly send me a short note that this mail was
     noticed as I'm not subscribed to the mailing list
     


/***********************************************************************
// patch 1 - <keys.h>
************************************************************************/

*** _old\keys.h	Mon Feb 27 03:07:34 1995
--- keys.h	Fri Apr 19 01:52:02 1996
***************
*** 45,49 ****
  #define K_Control_Y            0x019
  #define K_Control_Z            0x01a
! #define K_Control_LBracket     0x01a
  #define K_Escape               0x01b
  #define K_Control_BackSlash    0x01c
--- 45,49 ----
  #define K_Control_Y            0x019
  #define K_Control_Z            0x01a
! #define K_Control_LBracket     0x01b
  #define K_Escape               0x01b
  #define K_Control_BackSlash    0x01c
***************
*** 180,183 ****
--- 180,184 ----
  #define K_Alt_F9               0x170
  #define K_Alt_F10              0x171
+ #define K_Control_Print        0x172
  #define K_Control_Left         0x173
  #define K_Control_Right        0x174


/***********************************************************************
// patch 2 - src/libc/compat/stdlib/putenv.c
************************************************************************/

*** _old\putenv.c	Thu Jan 25 02:53:44 1996
--- putenv.c	Fri Apr 19 02:25:18 1996
***************
*** 9,13 ****
  
     This routine assumes that the environ array and all strings it
!    points to were malloc'd.  Nobody else should modify the environment
     except crt1.c
  
--- 9,13 ----
  
     This routine assumes that the environ array and all strings it
!    points to were malloc'd.  Nobody else should modify 'environ'
     except crt1.c
  
***************
*** 24,32 ****
    int vlen = strlen(val);
    char *epos = strchr(val, '=');
!   int nlen = epos - val + 1;
    int eindex;
  
    if (epos == 0)
      return -1;
  
    if (putenv_bss_count != __bss_count)
--- 24,33 ----
    int vlen = strlen(val);
    char *epos = strchr(val, '=');
!   int nlen;
    int eindex;
  
    if (epos == 0)
      return -1;
+   nlen = epos - val + 1;
  
    if (putenv_bss_count != __bss_count)


/***********************************************************************
// bug report 1 - signals [you probably know about that]
************************************************************************/

signal() and sigaction() should check the signal number (and SIGKILL)
and set errno on failure.
sigaction() does not return the current signal handler.


/***********************************************************************
// bug report 2 - src/libc/crt0/c1loadef.c 
************************************************************************/

I recently wanted to unset my environment for test purposes
and entered a 'set djgpp=x'. Unfortunately a file called 'x'
existed in my current directory and now every djgpp2 program 
crashed in the startup code.

I tracked down the problem and noticed the following in c1loadef.c:

- there are some loops that do not check the end of the file
  and access memory beyond the malloc'ed chunk !

- a little bit of parsing intelligence would help avoiding an
  unneccessary blowup of the environment in such cases
  (e.g. no whitespace before the '=')


- Raw text -


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