This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Determining if an address is valid prior to using it.
- From: jimmie dot davis at l-3com dot com
- To: <libc-help at sourceware dot org>
- Date: Wed, 23 Jul 2008 15:06:00 -0500
- Subject: Determining if an address is valid prior to using it.
Given an arbitrary address, is it possible to test and see if it is in
the process's address space ?
My current technique is to create a new thread, then access the memory
from that thread. Then if it did not segfault i know the address was
valid.
Is there a better way to do this ?
thanks,
bud davis
"Buy the ticket, take the ride."
Hunter S. Thompson