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-7-bit X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-08-09 15:53:55 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!louie!not-for-mail Sender: - From: Bart.Vanhauwaert@nowhere.be Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <9kp9n7$ivm$1@nh.pace.co.uk> <3B722166.AFBFE73A@home.com> User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.2.17-21mdksecure (i686)) Date: Thu, 9 Aug 2001 20:43:41 +0200 Message-ID: NNTP-Posting-Host: 194.78.202.248 X-Trace: 997397634 reader0.news.skynet.be 54315 194.78.202.248 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:11717 comp.lang.c:73276 comp.lang.c++:81387 Date: 2001-08-09T20:43:41+02:00 List-Id: Warren W. Gay VE3WWG wrote: >> I am not really sure where this is fundamentally different from >> for (std::vector::iterator i=v.begin(); i!=v.end(); ++i) >> ... >> and > Yes, but your STL classes cannot help you to deal with regular arrays. In Ada, > these attributes work on _any_ array. Not just ones cooked up by your STL > classes. Doctor it hurts if I do this. Well, don't do that then! Don't use arrays, use std::vector. > Fixed sized arrays occur all the time. When you fill out tax forms, > medical forms, drivers license forms, are not all the spaces fixed > in length? Fixed lengths occur all the time in programmed systems > as well. Well, I'd certainly NOT use a fixed length array for things you are likely to find on tax forms/medical forms/... Yes, i'd check validity at form entry (number of digits, format, etc) But i'd store it as a free form unlimited length string. Because it might be easy to change is array(1..12) of character to is array (1..13) of character. An indeed if you meticously used 'Length everywhere no problem. But once you start thinking this was it ends up in your protocols (oeps, lucky we had some reserved(1..12) of character at the end of our message!), in your file formats, etc.. where the real problems are. > Even when "length" is not fixed, often the maximum is. I know > the point you're making, but its not justified here. For example, > pipe(2) is not going to have a problem with an array of 2 file > descriptors in an int[2] array. It's never going to return more > than 2. No need to make a conspiracy out of it ;-) You know, you can still put those file descriptors in a std::vector and do pipe(&my_vector[0]); (Yes technically, the wording of the current C++ standard is not clear enough, but there is a defect report that rectifies this; it works for all current implementations of the STL already in anticipation of this correction) But the origin of this discussion was uses of 'Length operators and such. If it is only viable for arrays passed to pipe(2), well... That's little value isn't it? cu bart -- http://www.irule.be/bvh/