I found two bug in this function
1st) In case serialization string is length of string bigger
like number 9 (Exam s:13:")you start parse still from
position 5 -> This means you start parsing character "
2nd) I think you should substract -1 in both cases
charCodeAt>128 and charCodeAt>255. Finally function
should look like:
private function getCStringLenght (str:String):Number {
var len:Number = parseInt (this.buffer.substr (2,
this.buffer.indexOf (":", 3) - 2));
var i:Number;
var j:Number = len;
var startIndex:Number;
var cstr = this.buffer;
startIndex=4+len.toString().length;
for (i = 0; i < j; i++){
if (cstr.charCodeAt (i + startIndex) > 128){
j = j - 1
}
}
return j;
}; // getCStringLenght
Nobody/Anonymous ( nobody ) - 2005-08-02 16:52
5
Open
None
Nobody/Anonymous
None
None
Public
|
Date: 2009-02-20 00:24 This is pretty old but the exact same bug exists for double/int's where the |
|
Date: 2006-05-30 22:20 Logged In: YES |
|
Date: 2006-05-30 20:28 Logged In: NO |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use