File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ static CborError advance_recursive(CborValue *it, int nestingLevel)
486
486
}
487
487
488
488
/* map or array */
489
- if (nestingLevel == CBOR_PARSER_MAX_RECURSIONS )
489
+ if (nestingLevel == 0 )
490
490
return CborErrorNestingTooDeep ;
491
491
492
492
CborError err ;
@@ -495,7 +495,7 @@ static CborError advance_recursive(CborValue *it, int nestingLevel)
495
495
if (err )
496
496
return err ;
497
497
while (!cbor_value_at_end (& recursed )) {
498
- err = advance_recursive (& recursed , nestingLevel + 1 );
498
+ err = advance_recursive (& recursed , nestingLevel - 1 );
499
499
if (err )
500
500
return err ;
501
501
}
@@ -522,7 +522,7 @@ CborError cbor_value_advance(CborValue *it)
522
522
cbor_assert (it -> type != CborInvalidType );
523
523
if (!it -> remaining )
524
524
return CborErrorAdvancePastEOF ;
525
- return advance_recursive (it , 0 );
525
+ return advance_recursive (it , CBOR_PARSER_MAX_RECURSIONS );
526
526
}
527
527
528
528
/**
You can’t perform that action at this time.
0 commit comments