United States Argentina Australia Austria Belgium Canada Chile Colombia Costa Rica Dominican Republic France Germany Bangladesh/India Italy Kenya Mexico Netherlands Puerto Rico South Africa Sweden Switzerland Venezuela
BASIS International Ltd.
Home | Site Map | Contact Us | Partner Login  

 













BASIS Knowledge Base Article #01124

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