From: Zach Heilig Subject: Re: NULL pointers in (ANSI) string functions [was: strcat() ?] To: sandmann AT new-orleans DOT NeoSoft DOT com (Charles Sandmann) Date: Tue, 1 Nov 1994 20:53:47 -0600 (CST) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Charles Sandmann says: > DPMI does not currently have null pointer protection, so under DPMI you > would currently just use whatever happens to be in page 0 of the memory > block. Under V1.11 page 0 was never written, so your dpmi provider > probably had it all zeros. Due to a minor bug in the V1.12 LD, the > protection page wasn't being generated so the memory at location 0 was > being written with the COFF header (I think). I can't be sure this is true, > but because of the LD problem I don't think any (early?) V1.12 images > provide null pointer protection at all. > > Anyway, it will all get fixed someday, and work under DPMI too. Probably the easiest fix would be to change the NULL pointer to something way out of range, like maybe: 0xffffffff. It may break some code to have it != 0x00000000, but that code was really broken anyway, since a NULL pointer is definately not guaranteed to be 0x00000000 after translation is done. I don't know if there is an easy way to make gcc translate a 0 in a pointer context to the real NULL pointer, though. -- Zach Heilig (heilig AT aero DOT und DOT nodak DOT edu)