From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 2001-08-07 04:06:53 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Date: 7 Aug 2001 07:06:49 -0500 Organization: Berbee Information Networks Corporation Message-ID: <4pYjBGw2E9xb@eisner.encompasserve.org> References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <3b6a453c.1193942215@news.worldonline.nl> <9keejl$fhj@augusta.math.psu.edu> <3c30da40.0108060848.796d9bd9@posting.google.com> <3B6F3216.F410BBFF@home.com> <3B6F3FAE.B9B9FOrganization: LJK Software NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 997181954 2947 192.135.80.34 (7 Aug 2001 10:59:14 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Tue, 7 Aug 2001 10:59:14 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:11480 comp.lang.c:72654 comp.lang.c++:80607 Date: 2001-08-07T07:06:49-05:00 List-Id: In article , kaz@ashi.footprints.net (Kaz Kylheku) writes: > In article <3B6F5BB2.A879B933@worldnet.att.net>, James Rogers wrote: >> generic >> >> Max_Size : Positive; >> type Items is private; >> >> package Inventory is >> >> subtype Buf_Index is Positive range 1..Max_Size; >> type Parts_Buffer is array(Buf_Index) of Items; > > By the way, is there a reason why you didn't just use a modulo > type as the array index, one that will automatically wrap around > 1..Max_Size-1? One excellent reason might be that you don't want to wrap around. I cannot imagine many circumstances in which one whould want to silently wrap an index into a buffer.