www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/12/12:57:57

Date: Sun, 12 Jul 1998 19:56:49 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: DJGPP alpha 980628 (part 4)
Message-ID: <Pine.SUN.3.91.980712195437.27114e-100000@is>
MIME-Version: 1.0

djsplit assumed that at least 16384 bytes are available and never checked 
the returned value for zero.

*** src/utils/djsplit.c~0	Fri Mar  6 18:50:50 1998
--- src/utils/djsplit.c	Fri Jul 10 17:08:40 1998
*************** main(int argc, char **argv)
*** 47,52 ****
--- 47,60 ----
      bufsize /= 2;
      buf = malloc(bufsize);
    } while (buf == 0 && bufsize > 16384);
+ 
+   /* Protect against crazy DPMI hosts which
+      won't cooperate.  This really should never happen.  */
+   if (buf == NULL)
+   {
+     bufsize = 4 * 1024;		/* this will be painfully slow... */
+     buf = (char *) alloca(bufsize);
+   }
    printf("buf size: %d\n", bufsize);
  
    chunksize = strtol(argv[2], &endp, 0);

- Raw text -


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