From: Martin Str|mberg Message-Id: <199903232349.AAA01039@father.ludd.luth.se> Subject: Re: Patch: Child memory access in dbgcom checks page attributes To: nate AT cartsys DOT com Date: Wed, 24 Mar 1999 00:49:19 +0100 (MET) Cc: djgpp-workers AT delorie DOT com (DJGPP-WORKERS) X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hmm. Are you sure the part about the limit checking is correct? I ask because you are removing part of what I corrected some time ago. I think I got some response (I think it was on c.o.m.d) that the limit check would be better with something like you put in now. I tried that way, and sure enough gdb was still crashing for me. Hence I kept the more convoluted check. Unfortunately I can't remember what the case where gdb crashed was about (so I could test your patch). The change I object to is this: + if (a <= 4096) + return 1; /* Null page */ limit = __dpmi_get_segment_limit(__djgpp_app_DS); - if(4096 <= a /* First page is used for NULL pointer detection. */ - && a <= limit /* To guard against limit < len. */ - && a - 1 <= limit - len /* To guard against limit <= a + len - 1. */ - ) - return 0; -/* printf("Invalid access to child, address %#x length %#x limit: %#x\n", a, len, limit); - if (can_longjmp) - longjmp(debugger_jmpbuf, 1); */ - return 1; + if (a > limit || (a - 1) > (limit - len)) + return 1; /* Beyond limit */ A Shrine, Royalty, MartinS