Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Fix to protect against a Json.NET bug #6

Closed
JamesNK opened this issue Nov 29, 2013 · 6 comments
Closed

Fix to protect against a Json.NET bug #6

JamesNK opened this issue Nov 29, 2013 · 6 comments

Comments

@JamesNK
Copy link

JamesNK commented Nov 29, 2013

Hi

There is a bug in Json.NET that the Windows Azure Storage Client 3.0 is exposed to. Basically if the storage client is run using Json.NET 5.0.4 or earlier it will throw an error when foreaching over an array.

The fix is really simple. Change this line - https://github.com/WindowsAzure/azure-storage-net/blob/c9d52db3f18f971933111f5ba3f7ce4e79927a73/Lib/ClassLibraryCommon/Table/Protocol/TableOperationHttpResponseParsers.cs#L364 - to this:

JToken dataTable = dataSet["value"];

Removing the cast to JArray will stop your library from using the bad GetEnumerator method.

I'm going to fix this bug in Json.NET 6.0. At some point in the future when you upgrade to it you can choose to revert this change if you want.

@JamesNK
Copy link
Author

JamesNK commented Nov 29, 2013

More details about the Json.NET issue if you're interested - http://james.newtonking.com/archive/2013/11/29/fixing-jarray-getenumerator-method-not-found-bug

@jeffwilcox
Copy link

Thanks @JamesNK !

@veena-udayabhanu
Copy link
Contributor

Thanks JamesNK. Just to confirm, the client library requires Json .NET 5.0.6 or later. We specify that in the Nuspec. So users downloading our package are forced to reference 5.0.6 or later. So we should not be affected by this issue, correct?

@JamesNK
Copy link
Author

JamesNK commented Dec 3, 2013

The only way a user could run into this bug with the .NET Azure Storage client now is if an older version of Json.NET 5.0 is GACed and that is loaded instead.

I am going to change the JArray.GetEnumerator visibility in Json.NET 6 back to what is what in 5.0.4 (probably early January 2014) and you will need to make this change so Azure Storage works with Json.NET 5 & 6.

When do you plan to release the next version of storage client 3.0?

@veena-udayabhanu
Copy link
Contributor

We are planning to release a hotfix by the end of this week and have included this fix. Thanks again!

@joeg
Copy link
Contributor

joeg commented Dec 12, 2013

This has been resolved in 3.0.1

@joeg joeg closed this as completed Dec 12, 2013
asorrin-msft pushed a commit to asorrin-msft/azure-storage-net that referenced this issue Oct 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants