Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve infinity loop problem with invalid arrays #256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tehniss-nenad
Copy link

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'"

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'"
@Nick-vanGemeren
Copy link

Fine as far as it goes, although I would have rewritten the wholeIfas aSelect Case.

ButParseObjecthas the same issue. Both issues (and maybe others) can be solved by testing injson_SkipSpaces:

Private Sub json_SkipSpaces(json_String As String, ByRef json_Index As Long)
    ' Increment index to skip over spaces
    Do While VBA.Mid$(json_String, json_Index, 1) = " "
        json_Index = json_Index + 1
    Loop
    If json_Index > VBA.Len(json_String) Then
        Err.Raise 10001, "JSONConverter", json_ParseErrorMessage(json_String, _
             json_Index, "Unexpected end of input string - missing terminator?")
    End If
End Sub

@tehniss-nenad
Copy link
Author

I agree, json_SkipSpaces is better place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants