From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb0e,cdca3dc8d6167cd4 X-Google-Attributes: gidfdb0e,public X-Google-Thread: 1164f8,cdca3dc8d6167cd4 X-Google-Attributes: gid1164f8,public X-Google-Thread: f7344,a808e23c428d1184 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2001-12-22 13:11:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Message-ID: <3C24B0A4.68C19022@trailing-edge.com> Date: Sat, 22 Dec 2001 16:11:16 -0400 From: Tim Shoppa Organization: Trailing Edge Technology X-Mailer: Mozilla 3.03Gold (X11; I; OpenVMS V7.2 AlphaServer 1200 5/533 4MB) MIME-Version: 1.0 Newsgroups: comp.os.vms,alt.sys.pdp10,comp.sys.dec Subject: Re: Congratulations for the festive season References: <3roT7.207043$tf5.13617499@bin5.nnrp.aus1.giganews.com> <3C1ED472.7040102@qsl.network> <9vnh67$cct$1@bob.news.rcn.net> <3C23EA72.48874137@gce.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 63.73.218.130 X-Trace: 1009055475 reader0.ash.ops.us.uu.net 29397 63.73.218.130 Xref: archiver1.google.com comp.os.vms:56860 alt.sys.pdp10:8656 comp.sys.dec:10201 Dave Cherkus wrote: > > gce wrote in news:3C23EA72.48874137@gce.com: > > Not so. > > The reason for the lack of buffer overflows is due to a number of > > factors. One: VMS habitually has used descriptors to pass strings, > > which have sizes passed. > > Interesting. > > Was this true in the PDP11 operating systems? Most "system services" that deal with strings (i.e. filenames) under RSX-11 and RT-11 are working with fixed-size buffers, usually with RAD50 encoded strings. > I ask because the first place I saw the practice of zero-terminated > strings was when using a PDP11 MACRO assembler, which provided the > ASCIZ directive (ascii string, zero terminated). Yes null-terminated strings certainly are common on -11's, even if the OS didn't use them. > I always thought that's where UNIX picked up the practice, since > UNIX was mainly written on a PDP11, and perhaps used MACRO as a > bootstrap language. It was very common to do null terminated strings on -11's because of the ease of using the idiom 10$: MOV (R1)+,(R2)+ BNE 10$ to, for example, copy a null-terminated string. Note how this looks almost identical to the K&R C example of copying a null- terminated string! Despite this similarity I think I've seen Mr. Ritchie write that the C (B? BCPL?) postincrement syntax predated the arrival of their -11 in New Jersey. Tim.