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 07:45:22 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!newsfeed.mesh.ad.jp!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!koehler From: koehler@encompasserve.org (Bob Koehler) Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: Drop C/C++ better sooner than later Message-ID: 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 Date: 1 Mar 2001 10:40:30 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 983461239 216.44.122.34 (Thu, 01 Mar 2001 15:40:39 GMT) NNTP-Posting-Date: Thu, 01 Mar 2001 15:40:39 GMT Organization: Verio Xref: supernews.google.com comp.os.vms:20705 comp.sys.dec:2970 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); }