mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Potential JSON under-read fix
This commit is contained in:
parent
02e6fe9f8c
commit
ff6f15d3ef
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue