From d9b35012f4e5d85144ab1119440a8b5eca04d6bb Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Mon, 13 Apr 2020 16:18:41 +0200 Subject: [PATCH] Fix off by one when finding HaxeObject; JNI string 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. --- project/src/system/JNI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/system/JNI.cpp b/project/src/system/JNI.cpp index 51a1e149f..1f99c3603 100644 --- a/project/src/system/JNI.cpp +++ b/project/src/system/JNI.cpp @@ -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); @@ -2111,4 +2111,4 @@ extern "C" { } -} \ No newline at end of file +}