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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 107f24,582dff0b3f065a52 X-Google-Attributes: gid107f24,public 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-05 01:29:48 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news1.ebone.net!news.ebone.net!news.ipartners.pl!news.internetia.pl!mimuw.edu.pl!news.mimuw.edu.pl!not-for-mail From: Marcin 'Qrczak' Kowalczyk Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.functional Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Date: 5 Aug 2001 08:06:15 GMT Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?= Message-ID: References: <3B6555ED.9B0B0420@sneakemail.com> <87n15lxzzv.fsf@deneb.enyo.de> <3B672322.B5EA1B66@home.com> <5ee5b646.0108010949.5abab7fe@posting.google.com> <%CX97.14134$ar1.47393@www.newsranger.com> <3b690549.1112022840@news.worldonline.nl> <3B697DEF.5C7C0440@yahoo.com> NNTP-Posting-Host: zodiac.mimuw.edu.pl Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Trace: kenny.mimuw.edu.pl 997000065 25757 10.1.1.1 (5 Aug 2001 08:27:45 GMT) X-Complaints-To: abuse@news.mimuw.edu.pl NNTP-Posting-Date: Sun, 5 Aug 2001 08:27:45 +0000 (UTC) X-Original-Path: localhost!qrczak X-Licznik: 24262 X-Path-Notice: Path line has been filtered User-Agent: slrn/0.9.7.0 (pl-1.1.0) (Linux/2.2.17 (i686)) Xref: archiver1.google.com comp.lang.ada:11307 comp.lang.c:72265 comp.lang.c++:80050 comp.lang.functional:7311 Date: 2001-08-05T08:06:15+00:00 List-Id: Thu, 02 Aug 2001 17:30:17 GMT, CBFalconer pisze: > elsethread (I think) I recently made a recommendation about type > definitions, which could impose strong type checking in C at the > cost of a single new reserved word (I suggested deftype, if you > want to do a google search on c.l.c). Such a feature would go far > to removing out-of-bounds errors by insisting that an array be > indexed by a declared index type. Everything would be done at > compile time. I don't believe it would help much. Most arrays have sizes which are not compile time constants, so using a specific type for indexing doesn't make a difference. And arithmetic on the index type can still overflow, so it would have to be checked instead of array access. Haskell eliminates many range checks by 1) not using arrays but lists (this is not a great thing for efficiency but it is great for eliminating off-by-one errors), 2) providing functions which wrap common patterns of array usage, e.g. iteration over all elements or mapping each element by a function to a new array - implementation of these functions can skip range checks. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZAST�PCZA QRCZAK