Mail Archives: djgpp-workers/1997/06/19/12:15:23
> I think checking for pointers in the 0..4095 range would be worth it,
> but trying to handle all those other cases would be too much overhead,
> considering how long it's taken for it to become an issue.
Since most DPMI providers don't allow the null page protection, this is
probably a good idea. But I would define a macro like "if (_djbadptr(ptr))"
so if we decided to enhance/change/suppress it later, it's a change to a single
include file. Something like:
#define _djbadptr(ptr) (ptr < 0x10a8)
> if (_djbadptr(ptr))
> {
> errno = EFAULT;
> return -1;
> }
Other possibilities
#define _djbadptr(ptr) 0
#define _djbadptr(ptr) ((ptr < 0x10a8) || ptr > sbrk(0))
extern int _djbadptr();
- Raw text -