Skip to content

Commit 8e6717d

Browse files
unknownunknown
authored andcommitted
Fixes the depth limit on the Json serializer.
1 parent db2c403 commit 8e6717d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Selenium/Serializer/JsonReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private string DebugValue {
9292
}
9393

9494
private object DeserializeNext(int depth) {
95-
if (depth++ < DEPTH_MAX)
95+
if (depth-- < 1)
9696
throw new JsonException("DepthLimitExceeded", _index);
9797

9898
_index--;
@@ -410,7 +410,7 @@ private char DeserializeUnicode() {
410410
/// </summary>
411411
/// <returns>True if not end of bytes, false otherwise</returns>
412412
private bool MoveNextNonEmptyChar() {
413-
while (++_index < _length) {
413+
for (_index = _index + 1; _index < _length; _index++) {
414414
int b0 = _buffer[_index];
415415
if (b0 > 0x7F) {
416416
if (++_index >= _length)

0 commit comments

Comments
 (0)