🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #537

Re: ANSI C, hardware protection, out-of-bounds pointers

#537
From: Joseph S. D. Yao
Date: Thu, 07 Sep 1989 03:45
16 lines
1077 bytes
In article <427@maytag.waterloo.edu> lhf@aries5 (Luiz H. deFigueiredo) writes:
-ANSI C says that is *is* legal to use mention (but not dereference) a pointer
-just out-of-bounds as in
-
-	char a[N];
-	char *last=a+N;		/* Here! */
-	char *p;
-	for (p=a; p<last; p++)
-Now I ask, it is possible/legal to do the analogous thing for a-1 as in
-	char *head=a-1;		/* Here! */
-	for (p=last-1; p>head; p--)

This, too, is an out-of-bounds pointer, and is covered by the same
rule.  Nothing says that an OOB ptr has to be positively offset.

joe yao
Technical Details
Message-ID: <867@hadron.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!shlump.nac.dec.com!decuac!hadron!jsdy
References: <427@maytag.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!shlump.nac.dec.com!decuac!hadron!jsdy
From: jsdy@hadron.UUCP (Joseph S. D. Yao)
Newsgroups: comp.std.c
Subject: Re: ANSI C, hardware protection, out-of-bounds pointers
Keywords: ANSI C, hardware protection, out-of-bounds pointers
Message-ID: <867@hadron.UUCP>
Date: 7 Sep 89 03:45:27 GMT
References: <427@maytag.waterloo.edu>
Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao)
Organization: Hadron, Inc., Fairfax, VA
Lines: 16