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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107f24,582dff0b3f065a52 X-Google-Attributes: gid107f24,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-06 08:37:41 PST Path: archiver1.google.com!news2.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" 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 ofservice attack. Date: Mon, 6 Aug 2001 11:29:45 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9kmd5a$euq$1@nh.pace.co.uk> References: <3B6555ED.9B0B0420@sneakemail.com> <87n15lxzzv.fsf@deneb.enyo.de> <3B672322.B5EA1B66@home.com> <5ee5b646.0108010949.5abab7fe@posting.google.com> <3B6CD64F.E96911F8@yahoo.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 997111786 15322 136.170.200.133 (6 Aug 2001 15:29:46 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 6 Aug 2001 15:29:46 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:11376 comp.lang.c:72469 comp.lang.c++:80331 comp.lang.functional:7347 Date: 2001-08-06T15:29:46+00:00 List-Id: Or someone redefined you #define somewhere between when you declared your array and when you called the function. Never happens? What about when you start bringing in header files with the #include? How many times do programmers use names like "MAXSIZE" or "BUFFSIZE" or similar? How about really big files with dozens or hundreds of functions in them? Its *way* easy to get that kind of error into a program. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "CBFalconer" wrote in message news:3B6CD64F.E96911F8@yahoo.com... > David Lee Lambert wrote: > > > ... snip ... > > > > In C, one has to think ahead a little in some situations, but it's still > > quite straightforward to write overflow-free code once one has been > > introduced to the right functions: fgets(), snprintf(), (non-ANSI) > > strlcpy()... > > Oh, how about: > > #define BUF1SZ 10 > ... > #define BUF2SZ 20 > ... > char buff1[BUF1SZ] > ... > fgets(buf1, BUF2SZ, stdin); > > and I have no idea where the error will hit. The equivalent in > any range checking language will hit at the read, if not at the > compile. Before you say the programmer shouldn't have done that, > consider the thousands of lines that may be represented by the ... > and that the statements may even be in different files. >