mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-14 12:15:05 +00:00
fix: Potential JSON under-read fix
This commit is contained in:
@@ -155,9 +155,14 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
while (reader.TokenType != JsonToken.EndObject)
|
while (reader.TokenType != JsonToken.EndObject)
|
||||||
{
|
{
|
||||||
if (reader.TokenType != JsonToken.PropertyName)
|
if (reader.TokenType != JsonToken.PropertyName)
|
||||||
throw new FormatException();
|
throw new FormatException(string.Format("Expected token {0} got {1}", JsonToken.PropertyName, reader.TokenType));
|
||||||
|
|
||||||
switch ((string)reader.Value)
|
string propertyName = (string)reader.Value;
|
||||||
|
|
||||||
|
// Step into the value
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
switch (propertyName)
|
||||||
{
|
{
|
||||||
case PROPERTY_KEY:
|
case PROPERTY_KEY:
|
||||||
key = readKey(extends, reader);
|
key = readKey(extends, reader);
|
||||||
|
|||||||
Reference in New Issue
Block a user