Referencing NULL pointers

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Jul 11 10:53:38 AEST 1989


In article <19367 at paris.ics.uci.edu> T.S. Hadley <hadley at icarus.ics.uci.edu> writes:
>   Apparantly, on other machines this is perfectly valid, since I see
>   quite a lot of this in code created on certain non-sun machines.

No, dereferencing via a null pointer is never valid in C.
It happened that one could get away with it under certain circumstances
using certain C implementations (e.g. some a.out types on 4BSD on a VAX).
That unfortunately delayed detection of such bugs until such time as the
programs were ported to systems where null pointer dereferencing was not
"benign".  By now, recent versions of UNIX should have found and fixed
the vast majority of such bugs.



More information about the Comp.unix.wizards mailing list