Main Menu

KB#01124-BASIC Web utility Duplicate Name in String Template generating an error 17

Title:

BASIC Web utility Duplicate Name in String Template generating an error 17

Description:

Duplicate name for the template in utcg1.wbb generating an error 17 on line 320 in some circumstances. 
Occasionally, the HTTP headers from some clients contain two values that have no valid characters other than HTTP. In utcgi.wbb, there is a routine FIXNAME that manipulates a name to force it to be a valid variable suitable for use in a template. There is no protection against a duplicate result. 

The problem occurs in the following code fragment in utcgi.wbb: 


0250 L290: let ITEM$=info(4,SEQ,err=L360),SEQ=SEQ+1 

0260 L300: let X=pos("="=ITEM$); if X=0 then goto L230 0270 let NAME$=ITEM$(1,X-1),VAL$=ITEM$(X+1) 

0280 let X$=NAME$; gosub FIXNAME; if len(NAME$)>32 or len(X$)>32 then goto L230 else let TPL$=TPL$+X$+":c(1*=0)," 

0290 let VALS$=VALS$+VAL$+$00$ 

0300 let X$=stbl(cvs(NAME$,4),VAL$); rem "set STBL's to environment values 0310 goto L230 

 

Resolution:

Change line 280 to the following: 


let X$=NAME$; gosub FIXNAME; if len(x$)>32 or len(X$)>32 or pos(","+x$+":"=tpl$)>0 then goto L230 else let TPL$=TPL$+X$+":c(1*=0)," 



Last Modified: 10/18/2006 Product: BASIC Web Utility Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel