Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!dbj@rice From: dbj%rice@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: Dereferencing NULL Message-ID: <14195@sri-arpa.UUCP> Date: Wed, 30-Nov-83 21:32:43 EST Article-I.D.: sri-arpa.14195 Posted: Wed Nov 30 21:32:43 1983 Date-Received: Sun, 4-Dec-83 03:40:44 EST Lines: 23 From: Dave Johnson I don't want to start another dereferencing NULL discussion (it's a bad idea, but too much code does it to change), but Ron Natalie's last message contained a couple of incorrect statements that should be cleared up. First, the different ioctl's in Unix (at least in 4.1 and System 5) are each processed by different cases of a switch statement (one in the tty driver, one in the tape driver in 4.1, etc). The ones that don't expect a third argument (which can thus be zero) never reference it. They don't try to indirect through the third argument before they find out that they don't need it. Also, under 4.1 at least, all the ioctl's that take a pointer to a number for the third argument actually take an (int *). If you indirect through 0 to pick up an integer, you don't get 0, you get 14693172 or 0x08c20000. There is a zero at address zero, but it is only 16 bits worth of zero, not a whole integer. Dave Johnson Dept. of Math Science Rice University dbj@rice