From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,8be18979db11f51c X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,fb631c9316319fef X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2001-03-01 09:42:44 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!newsfeed.wirehub.nl!newsfeed.mesh.ad.jp!sjc1.nntp.concentric.net!newsfeed.concentric.net!global-news-master From: "Rick Cadruvi" Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: Drop C/C++ better sooner than later Date: 01 Mar 2001 17:38:44 GMT Organization: Concentric Internet Services Message-ID: <97m1f4$ku3@dispatch.concentric.net> References: <87n1baae6s.fsf@prep.synonet.com> <97bm3a$7tv@gap.cco.caltech.edu> <3A99AED0.5DF07890@infopuls.com> <97cd06$hcn$1@pyrite.mv.net> <97egck$vc6$3@info.cs.uofs.edu> <3A9AEFCD.AFC8431@infopuls.com> <97etsu$j41$1@pyrite.mv.net> <3A9B023A.CBD414A5@infopuls.com> <97Organization: Encompasserve NNTP-Posting-Host: 64.0.157.124 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: supernews.google.com comp.os.vms:20733 comp.sys.dec:2978 Your point only goes to the C libraries and NOT the language itself. You could certainly make the point that unthinking use of the libraries is a problem. It may also be true that other languages don't have such hacks for library routines. Maybe the reason I don't have troubles with C is I don't use the library routines much in real code, just test programs. rick... "Bob Koehler" wrote in message news:Y$aqbQdRtYFw@eisner.encompasserve.org... > > The following simple little C program has a security hole a mile > wide in it. > > I know I could plug the hole. I also know a lot of C programmers who > can't see the hole and have no idea that it's there. > > I know I could massage this to get through a C++ compiler, so this > critisism also applies to C++. > > I know I need a lot of technical information to take advantage of the > hole. > > Most importantantly I know of no other language in which this is so > easy to do, or so hard to see. Which is the point. > > > #include > #include > > main () > { > FILE *inp; > char buffer[81]; > int count; > > inp = fopen("indata","r"); > > if (inp == NULL) > { > perror("unable to open indata"); > exit(0); > } > > count = fscanf(inp, "%s", buffer); > if (count != 1) > { > fprintf(stderr,"where's the data?\n"); > exit(0); > } > > printf("%s\n",buffer); > > }