Mail Archives: djgpp-workers/1998/07/12/12:57:57
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 -