Skip to content

Commit

Permalink
Fix off by one when finding HaxeObject; JNI string
Browse files Browse the repository at this point in the history
This PR fixes an off by one in `strncmp(src,"org/haxe/lime/HaxeObject;", 24)` call. The string literal `"org/haxe/lime/HaxeObject;"` has a length of 25 and so the current implementation would also match e.g. `"org/haxe/lime/HaxeObjectSOMETHING;"` strings.
  • Loading branch information
disconnect3d authored and jgranick committed Apr 13, 2020
1 parent fcac041 commit d9b3501
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions project/src/system/JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ namespace lime {

outType = JNIType (jniObjectString, inDepth);

} else if (!strncmp(src,"org/haxe/lime/HaxeObject;", 24)) {
} else if (!strncmp(src,"org/haxe/lime/HaxeObject;", 25)) {

outType = JNIType (jniObjectHaxe, inDepth);

Expand Down Expand Up @@ -2111,4 +2111,4 @@ extern "C" {
}


}
}

0 comments on commit d9b3501

Please sign in to comment.