NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rob Kolanko on July 08, 2013, 12:09:12 PM

Title: Nulls in String in a browse field cause "Index out of range" error.
Post by: Rob Kolanko on July 08, 2013, 12:09:12 PM
Hi Bruce,
If a string variable accidentally has NULL character(s) in it and the variable is displayed as string browse field, the Server program will crash with a  "Index out of range" error.
Through GPF reporter, I isolated that line that causes the error.
In NetWebServerWorker.AsciiToUtf method, there is a line :

if Ascii[val(p_text

- if p_text
 
I have put a check for the file variable that caused the problem in my application and it is the programmer's responsibility to pass a valid string. However, I believe that it is pertinent to have a index check in the AsciiToUtf method to handle nulls.  

Perhaps add this code prior to the above line:
    if p_text
      p_text
    END

Thanks
Rob
Title: Re: Nulls in String in a browse field cause "Index out of range" error.
Post by: Bruce on July 08, 2013, 09:57:51 PM
yes, I agree - done for 7.15

cheers
Bruce