www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/06/12/11:54:12

Date: Wed, 12 Jun 1996 19:48:46 +0400 (MSD)
From: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Message-Id: <199606121548.TAA02454@video.yars.free.net>
To: djgpp-workers AT delorie DOT com, eliz AT is DOT elta DOT co DOT il, sandmann AT clio DOT rice DOT edu
Subject: Re: Printer error

I made some modifications to my last flsbuf.c to fix the bug and btw
found a little hole in Eli's patch (see below). I have not yet tested
my new version, I'll post my patch when I'll do it.

!   if ((base = f->_base) == NULL && (f->_flag & _IONBF) == 0)
!   {
!     size = _go32_info_block.size_of_transfer_buffer;
!     if ((f->_base = base = malloc (size)) == NULL)
!       f->_flag |= _IONBF;
		^^^ no buffer, the code under &_IOLBF can still crash
!     else
!     {
!       f->_flag |= _IOMYBUF;
!       f->_bufsiz = size;
!       if (f == stdout && isatty (fileno (stdout)))
! 	f->_flag |= _IOLBF;
!       else
! 	rn = n = 0;
! 
!       f->_ptr = base;
!       f->_cnt = f->_bufsiz;
!     }
!   }
! 
    if (f->_flag&_IOLBF)
    {
      base = f->_base;

- Raw text -


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