From:	SMTP%"VMSGopher-L@trln.lib.unc.edu" 19-JAN-1994 17:38:05.63
To:	EVERHART
CC:	
Subj:	RE: Crash in Gopher2.010 client in VIfromLine, since there a fix?

X-ListName: Gopher for VMS implementation and testing
    <VMSGopher-L@trln.lib.unc.edu>
Warnings-To: <>
Errors-To: postmaster@trln.lib.unc.edu
Sender: postmaster@trln.lib.unc.edu
To: <vmsgopher-l@trln.lib.unc.edu>
Subject: RE: Crash in Gopher2.010 client in VIfromLine, since there a fix?
Message-ID: <19JAN94.17181940@pfc.mit.edu>
From: mrl@pfc.mit.edu (Mark London)
Reply-To: VMSGopher-L@trln.lib.unc.edu
Date: 19 JAN 94 17:18:19 GMT
Organization: MIT PLASMA FUSION CENTER

I recently had Gopher2.011 crash when it received a bad tuple tried to process
view  info  that  was  not  correct.  You can duplicate the problem by doing:

gopher gopher.mit.edu
(pick item 8. other information servers)
(pick item 1. Gophers by subject)
(pick item 1. Gophers by subject Rice Univ)
(pick item 5. Search all of Gopherspace by title)
(pick item 18. How to compose veronica queries) PICKING ITEM 18 DOES NOT WORK

There needs to be code in VIfromLine in VIEWS.C to ensure that the  view  info
is  correct.   I put in a small fix which checks for the existance of a <, and
if not there to reject the info.  This fixed this  case,  but  there  probably
should  be further checks to be more robust, but I do not know exact format of
a view.  Here is the patch (P.s. this was generated by the DIFF-PATCH software
available on the vms duplicating the unix commands.)

*** [gopher.object]views.c;-1
--- [gopher.object]views.c
**************
*** 231,236
       while (*line != '<' && *line != '\0')
  	  line ++;

       line++;

       for (cp = line,i=0; (*cp!='\0'&& *cp!='>'); cp++,i++)
--- 231,239 -----
       while (*line != '<' && *line != '\0')
  	  line ++;

+      if (*line == '\0')
+ 	  return(FALSE);
+
       line++;

       for (cp = line,i=0; (*cp!='\0'&& *cp!='>'); cp++,i++)


Mark London
MRL@PFC.MIT.EDU
