From 4b963588789fd38e505e49a3c1d05030a00d29f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Gonz=C3=A1lez?= Date: Wed, 12 Feb 2025 14:09:26 -0300 Subject: [PATCH] Fix StackOverflowException when instantiating JSONObject on Android --- common/src/main/java/com/genexus/json/JSONTokenerWrapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/genexus/json/JSONTokenerWrapper.java b/common/src/main/java/com/genexus/json/JSONTokenerWrapper.java index 6094ee009..ade1f07ed 100644 --- a/common/src/main/java/com/genexus/json/JSONTokenerWrapper.java +++ b/common/src/main/java/com/genexus/json/JSONTokenerWrapper.java @@ -1,5 +1,6 @@ package com.genexus.json; +import org.json.JSONObject; import org.json.JSONTokener; import org.json.JSONException; @@ -14,7 +15,7 @@ public Object nextValue() throws JSONException { this.back(); if (c == '{') { try { - return new JSONObjectWrapper(this); + return new JSONObjectWrapper((JSONObject) super.nextValue()); } catch (StackOverflowError e) { throw new JSONException("JSON Array or Object depth too large to process.", e); }