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

JSON parse bug #28

Open
filippz opened this issue Apr 15, 2014 · 5 comments
Open

JSON parse bug #28

filippz opened this issue Apr 15, 2014 · 5 comments
Assignees
Labels

Comments

@filippz
Copy link

filippz commented Apr 15, 2014

I've just discovered a bug in QDropboxJson::parseString function (qdropboxjson.cpp). The issue is that if json string contains [ character that is quoted, parser gets confused and sets isArray=true , but the value isn't really an array because it's string value under quotes.

The fix would be that under switch(strJson.at(i).toLatin1()) and case '[': the line isArray=true should be prefixed with if (!openQuotes) , so that isArray is not set if we're parsing quoted text.
I've not tested this extensively, but for my case (dropbox folder with [ in it's name) it works OK.

Thanks

@lycis lycis self-assigned this Apr 15, 2014
@lycis lycis added this to the Current (now to 6 months) milestone Apr 15, 2014
@lycis
Copy link
Owner

lycis commented Apr 15, 2014

I will take a look at this issue within the next days. Thank you for reporting and investigating!

@lycis
Copy link
Owner

lycis commented Apr 21, 2014

Also fixed parsing of curly brackets with the referenced commit.

@lycis lycis closed this as completed Apr 21, 2014
@filippz
Copy link
Author

filippz commented Apr 21, 2014

Thanks for the fix, but I haven't tested curly brackets (until now) and unfortunately if folder name contains just one curly bracket (either one) parsing doesn't work OK. Solution is to prefix inJson++; and inJson--; under case '{': and case '}': in function QDropboxJson::getArray with if (!inString)

@lycis
Copy link
Owner

lycis commented Apr 22, 2014

Thanks for testing!

Unfortunately I did not merge all changes into the master branch. This is why this still fails. I will add those changes sometime today.

@lycis lycis reopened this Apr 22, 2014
@Lu-Gru
Copy link

Lu-Gru commented Dec 13, 2015

Run into this problem today, this is not yet fixed (master branch).

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

No branches or pull requests

3 participants