TCP-group 1995
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: NOTICE-WARNING- TIME BOMB!!
- To: karn@qualcomm.com (Phil Karn)
- Subject: Re: NOTICE-WARNING- TIME BOMB!!
- From: Paul Traina <pst@cisco.com>
- Date: Tue, 24 Jan 1995 14:18:50 -0800
- Cc: tcp-group@ucsd.edu, nos-bbs@hydra.carleton.ca
- In-reply-to: karn@qualcomm.com's message of 23 Jan 1995 20:44:28 PST
> This reminds me...
>
> One of the items on my list of things-to-do for my next release of NOS
> (yes! I really do plan such a thing!) is a set of macro wrappers for
> all functions that free pointer args.
>
> For example, I'll create the following macro:
>
> #define FREE_P(x) {free_p(x); x = NULL;}
>
> and then replace all calls to the function free_p() with calls to the
> macro FREE_P().
>
> The idea, of course, is to immediately nail any pointer that points to
> a freed object. I tried to do this "manually" in many places, but I'm
> sure I've missed many spots. This should make it much harder to get a
> "freeing garbage" message.
>
> Why this has to be done in macros instead of as modifications to
> the function is left as an exercise for the beginning C student... :-)
>
> Phil
>
What we did was also poison the memory freed with 0x0d's so any deref
would cause a fault and a crash right away.