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

Fixed spurious start_map_key/start_array_item calls #568

Merged
merged 1 commit into from Mar 5, 2017

Conversation

dstahlke
Copy link

@dstahlke dstahlke commented Mar 2, 2017

Empty arrays/maps can cause spurious calls to visitor functions. The attached test case parses the message [{},{}] and produces the following output:

start_array 2
start_array_item
start_map 0
end_map
end_array_item
start_array_item
start_map_key
start_map 0
end_map
end_array_item
end_array

Notice the start_map_key call occurs outside of the map (and in fact there should be no keys for an empty map).

msgpack_bug.txt

@redboltz
Copy link
Contributor

redboltz commented Mar 5, 2017

@dstahlke , thank you for sending the PR. It looks good to me.

The PR fixes not only [{}{}] but also [[][]].

I will merge it.

@redboltz redboltz merged commit 1bc27d7 into msgpack:master Mar 5, 2017
@dstahlke
Copy link
Author

dstahlke commented Mar 5, 2017

Thanks.

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