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-06 20:04:06 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc2.on.home.com.POSTED!not-for-mail Message-ID: <3B6F5AAB.CF3A6ECA@home.com> From: "Warren W. Gay VE3WWG" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 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. References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <3B6F312F.DA4E178E@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 07 Aug 2001 03:04:05 GMT NNTP-Posting-Host: 24.141.193.224 X-Complaints-To: abuse@home.net X-Trace: news1.rdc2.on.home.com 997153445 24.141.193.224 (Mon, 06 Aug 2001 20:04:05 PDT) NNTP-Posting-Date: Mon, 06 Aug 2001 20:04:05 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:11441 comp.lang.c:72608 comp.lang.c++:80521 Date: 2001-08-07T03:04:05+00:00 List-Id: Kaz Kylheku wrote: > > In article <3B6F312F.DA4E178E@home.com>, Warren W. Gay VE3WWG wrote: > >The STL is not used in all contexts (it's just not practical). If you call > >pipe(2), you will not be using a vector from the STL. You'll use a naked > >int[2] array. This is only one example. > > Note that pipe() is an entry point into a POSIX operating system. Unless > you have POSIX Ada bindings, you are going to have to use the C interface > to call this thing at some point. The same goes for whatever programming > language you are using. Yes. So? > In C++, you have the advantage that you can use the C bindings directly. > It takes very little additional work to make C headers useable by a C++ > implementation. This is a minor inconveniance for Ada, yes. But it is neither rocket science, nor a difficult thing to do. I do it in my sleep ;-) > So you can make some class that encapsulates pipes, based directly on > the C interface. Yes, you _can_, but how often is that done? The point I was making was there are a _lot_ of similar circumstances, where C++ would have to deal with this, and often the short cut is taken instead. Even when someone takes the trouble to encapsulate the POSIX call, this means that _this_ component is at least vulnerable to array bounds errors and is subject to testing/debugging. This is the "weakest link!" ;-) OTOH, if you define an array of two integers in Ada, even the "binding" has all array accesses checked, on this side of the POSIX call. Not so in your C++ wrapper class. I'll grant that this is a simple case, but simple cases are best for illustration purposes. This is only one of many that could be made. -- Warren W. Gay VE3WWG http://members.home.net/ve3wwg