Argument validity checking (addresses)

Scott MacHaffie machaffi at fred.cs.washington.edu
Mon Feb 5 14:54:42 AEST 1990


In article <1990Feb3.052307.12524 at wolves.uucp> ggw at wolves.UUCP (Gregory G. Woodbury) writes:
>The validity I was trying to insure was that the
>subroutine can pull bytes (or whatever) from the given address, or that
>the given address can be called as a function without *immediately* killing
>the process.

If you are expecting a function pointer and are passed a character pointer,
for example, then the process will probably die as soon as you call the
"function".  As an example, suppose that you are passed a pointer to
a character string which just happens to be the same as a function prolog
-- except that the first "instruction" is an illegal memory access.
Thus, the same problem returns for testing for valid function pointers.

			Scott MacHaffie



More information about the Comp.lang.c mailing list