RTC Forums
November 23, 2024, 11:23:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Bug in Mime_DecodeEx - range check error  (Read 5096 times)
Max Terentiev
RTC License
***
Posts: 49


« on: February 06, 2017, 03:52:09 PM »

Hi Danijel,

Mime_DecodeEx fails with Range check error on this base64 string:

/v///wABAAAAAERYVUZNVAYEAAAAegB6ADEAJQABAAAABQAAAEUAbQBhAGkAbAASBAAAAHoAegAxACUA

Try:

Mime_DecodeEx(RtcStringToBytes('/v///wABAAAAAERYVUZNVAYEAAAAegB6ADEAJQABAAAABQAAAEUAbQBhAGkAbAASBAAAAHoAegAxACUA'));

And you got range check error exception. This bug affects json parser (TRtcByteStream.FromJson) so, it's serious problem !
Logged
Max Terentiev
RTC License
***
Posts: 49


« Reply #1 on: February 06, 2017, 05:27:27 PM »

This base64 string returned from your MimeEncode function. Initialy I load data this way:

TBlobField(LocalQuery.FieldByName('SegmentCriteria')).SaveToStream(MyResultRecord.NewByteStream('SegmentCriteria'));

And same base64 string returned by delphi's TNetEncoding.Base64.Encode and any online base64 encoder in Internet.

Here is original binary data file wich converted to base64:

https://drive.google.com/file/d/0B2yvbcYNT3ubZE1tUTJMbUJMd1U/view

Download it and convert to base64 using your Mime encoding routines, delphi RTL routines or using any online base 64 converter like this
http://base64-encoding.online-domain-tools.com/
or this
http://www.motobit.com/util/base64-decoder-encoder.asp

and you got same string: /v///wABAAAAAERYVUZNVAYEAAAAegB6ADEAJQABAAAABQAAAEUAbQBhAGkAbAASBAAAAHoAegAxACUA

So, it's MUST be valid !
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #2 on: February 06, 2017, 06:28:09 PM »

Please, download RTC SDK v7.77 (just released) and let me know if you still get range check errors, or bump into any other problems with Mime_Decode or Mime_DecodeEx functions.

Best Regards,
Danijel Tkalcec
Logged
Max Terentiev
RTC License
***
Posts: 49


« Reply #3 on: February 06, 2017, 06:33:18 PM »

It's works now ! Thank you very much !

Your support is amazing ! )
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 16 queries.