Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site allegra.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!jpl From: jpl@allegra.UUCP (John P. Linderman) Newsgroups: net.unix-wizards,net.bugs Subject: Re: MAJOR BUG (what a hooter!) Message-ID: <2421@allegra.UUCP> Date: Tue, 17-Apr-84 17:10:51 EST Article-I.D.: allegra.2421 Posted: Tue Apr 17 17:10:51 1984 Date-Received: Wed, 18-Apr-84 07:27:06 EST Organization: AT&T Bell Laboratories, Murray Hill Lines: 39 Things are even worse than Philip Poulos let on. Here is the routine he suggested removing (a suggestion I am implementing as fast as `make' can run): checkmodeline(line) char *line; { char *beg, *end; char cmdbuf[1024]; char *index(), *rindex(); beg = index(line, ':'); if (beg == NULL) return; if (beg[-2] != 'e' && beg[-2] != 'v') return; if (beg[-1] != 'x' && beg[-1] != 'i') return; strncpy(cmdbuf, beg+1, sizeof cmdbuf); end = rindex(cmdbuf, ':'); if (end == NULL) return; *end = 0; globp = cmdbuf; commands(1, 1); } Because of the way it checks for "ex:" or "vi:", it will also accept "ei:" or "vx:". Because of the way it fails to check that the ':' is at least 2 characters into the line, it might also accept "x:", "i:" or just ":", depending on the state of the chars in front of the linebuf array. If you are willing to live with this "feature", you probably won't care about accepting bogus keywords, but you can sleep a little easier if you do something like if ((beg == NULL) || (beg < (line + 2))) return; if (strncmp(beg-2, "ex", 2) && strncmp(beg-2, "vi", 2)) return; John P. Linderman Department of Fun Software allegra!jpl