From 5c6a4bb894d1c8d319f799742b7c7b846f95adc0 Mon Sep 17 00:00:00 2001 From: tehniss-nenad <67579141+tehniss-nenad@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:01:34 +0200 Subject: [PATCH] Resolve infinity loop problem with invalid arrays Before this patch, the application hangs if you do not close the array or string in array. For example "['val1','val2','val3]" or "['val1','val2','val3'" --- JsonConverter.bas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JsonConverter.bas b/JsonConverter.bas index 876b865..021f2e0 100644 --- a/JsonConverter.bas +++ b/JsonConverter.bas @@ -507,6 +507,8 @@ Private Function json_ParseArray(json_String As String, ByRef json_Index As Long ElseIf VBA.Mid$(json_String, json_Index, 1) = "," Then json_Index = json_Index + 1 json_SkipSpaces json_String, json_Index + ElseIf VBA.Mid$(json_String, json_Index, 1) = vbNullString Then + Err.Raise 10001, "JSONConverter", json_ParseErrorMessage(json_String, json_Index, "Expecting closing string or array") End If json_ParseArray.Add json_ParseValue(json_String, json_Index)