lib/javacompat: Fixed JavaCompat::importJavaString() hanging when trying to import long strings

This was caused by an integer overflow due to using a too small data type in a counter variable.
Soda
BodgeMaster 2022-09-11 09:08:08 +02:00
parent 48f8a7dcf2
commit 58b1199e38
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ namespace JavaCompat {
return ErrorOr<tiny_utf8::string>(true, ErrorCodes::MISMATCHEDSIZE);
}
for(uint8_t i=2; i<size+2; i++){
for(uint16_t i=2; i<size+2; i++){
if(i != 0){
if(data[i] == 0x80 && data[i-1] == 0xc0){
stdString[stdString.length() - 1] = '\0';