Menu

#14 MultiByte Unselialize BUG

open
nobody
None
5
2014-07-26
2007-08-22
Anonymous
No

I corrected trouble in the part where the character of MultiByte was processed.

for Ver 2.1.6
line 241~

OLD:
for (i = 0; i < j; i++){
if ((cstr.charCodeAt (i + startIndex) > 128) && (cstr.charCodeAt (i + startIndex) < 2048)){
j = j - 1
}
}

NEW:
for (i = 0; i < j; i++){
if ((cstr.charCodeAt (i + startIndex) > 128) && (cstr.charCodeAt (i + startIndex) < 2048)){ j = j - 1 }
if ((cstr.charCodeAt (i + startIndex) > 2047) && (cstr.charCodeAt (i + startIndex) <65536)){ j = j - 2 }
if (cstr.charCodeAt (i + startIndex) >65535) { j = j - 3 }
}

Discussion


Log in to post a comment.