From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay2.UU.NET ([192.48.96.7]) by hawkwind.utcs.toronto.edu with SMTP id <2060>; Mon, 20 Sep 1993 21:24:24 -0400 Received: from spool.uu.net (via LOCALHOST) by relay2.UU.NET with SMTP (5.61/UUNET-internet-primary) id AB22226; Mon, 20 Sep 93 21:24:07 -0400 Received: from srg.UUCP by uucp2.uu.net with UUCP/RMAIL (queueing-rmail) id 212256.20507; Mon, 20 Sep 1993 21:22:56 EDT Received: from ceres.srg.af.mil by srg.srg.af.mil id aa16151; Mon, 20 Sep 93 20:33:47 EDT From: culliton@srg.af.mil (Tom Culliton x2278) X-Mailer: SCO System V Mail (version 3.2) To: rc@hawkwind.utcs.toronto.edu Subject: A potentially useful patch Date: Mon, 20 Sep 1993 20:33:48 -0400 Message-Id: <9309202033.aa10448@ceres.srg.af.mil> Sigh.... While trying to get Alan's read integrated I rediscovered that SCO-ODT 1.1 has a broken realloc. It dumps core when it gets a null pointer for the old buffer. Fortunately Byron's code doesn't seem to rely on this behaviour. Just in case though, here's a patch for other folks in the same boat. Tom *** config.h.old Wed Feb 3 15:37:36 1993 --- config.h Mon Sep 20 20:29:01 1993 *************** *** 108,113 **** --- 108,122 ---- #define NOJOB */ + /* + * SCO-ODT 1.1 has a broken realloc which dumps core when it gets a null + * pointer for the old buffer. Byron's code doesn't seem to rely on this + * behaviour, but just in case something in the future does, you can define + * this to enable a fanny shield. Don't do it unless you know that you + * have this problem. + #define BROKENREALLOC + */ + /* Beginning of defaults section: */ #ifndef CUSTOM *** nalloc.c.old Thu Feb 27 02:22:10 1992 --- nalloc.c Mon Sep 20 19:43:52 1993 *************** *** 122,127 **** --- 122,132 ---- extern void *erealloc(void *p, SIZE_T n) { extern void *realloc(void *, SIZE_T); + #ifdef BROKENREALLOC + if (!p) { + p = ealloc(n); + } else + #endif if ((p = realloc(p, n)) == NULL) { uerror("realloc"); rc_exit(1);