NetTalk Central

Author Topic: NT 7.31 "Index out of range" message from NetWebServerWorker.UTFToAscii  (Read 2723 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Hi Bruce,
In my NT web applications, I added a message hook procedure to handle any messages that clarion can throw in server application. If an "Index out of range" error message is triggered then message hook procedure forces the application to GPF. (peek into address 0). This forces the GPF Reporter to dump the procedure stack where I am able to isolate the code that caused the "Index out of range" error.
At a customer site an "Index out of range" error was reported.  The GPF reporter dump revealed that error occurred in NetWeb.clw at line 11518. This is in the NetWebServerWorker.UTFToAscii  method at a following line:
   if utfmap[utf] > 0
The line before is
   if utf <= maximum(utfmap,1)
so variable "utf" must be zero or less to cause the Index out of Range error.  I modified the range change code (see green text)  to check for values below the range of the array.
   if utf <= maximum(utfmap,1) and utf > 0
      if utfmap[utf] > 0
   …..
   else
      returnValue[y] = chr(255) ! probably means the utfmap needs to be expanded
   end
Thus if variable "utf" is zero or less, the character is handled as if it was not a valid character.

I cannot duplicate the error but it has happened twice at a customer site. I do not know how the customer  is managing to get a null into the variable.  But they have a number of international users, I suspect it is the entry of some special character. Please consider adding a similar range check on this index variable to the array in a future NT release.

Thanks,
Rob Kolanko
« Last Edit: February 28, 2014, 11:57:40 AM by Rob Kolanko »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT 7.31 "Index out of range" message from NetWebServerWorker.UTFToAscii
« Reply #1 on: February 28, 2014, 09:16:16 PM »
Thanks for the feedback Robert.
I've seen this one before though, quite recently so I think it's already fixed. I'd have to check the release notes though to see if it's in the current build, or waiting for the next build release.

Cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Hey Rob,

Just wondering how you did your message hook thingy (if you're okay saying)?

I'm getting some "Index out of range" errors, and would LOVE to have them go to GPF Reporter.
Cheers,

Stu Andrews