File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ public override BList Parse(BencodeStream stream)
6464 }
6565
6666 if ( stream . ReadChar ( ) != 'e' )
67+ {
68+ if ( stream . EndOfStream ) throw InvalidBencodeException < BList > . MissingEndChar ( ) ;
6769 throw InvalidBencodeException < BList > . InvalidEndChar ( stream . ReadPreviousChar ( ) , stream . Position ) ;
70+ }
6871
6972 return list ;
7073 }
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ public override BNumber Parse(BencodeStream stream)
5151
5252 // Last read character should be 'e'
5353 if ( c != 'e' )
54+ {
55+ if ( stream . EndOfStream ) throw InvalidBencodeException < BNumber > . MissingEndChar ( ) ;
5456 throw InvalidBencodeException < BNumber > . InvalidEndChar ( c , stream . Position ) ;
57+ }
5558
5659 var isNegative = digits [ 0 ] == '-' ;
5760 var numberOfDigits = isNegative ? digits . Length - 1 : digits . Length ;
You can’t perform that action at this time.
0 commit comments