File tree 2 files changed +6
-0
lines changed
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)
64
64
}
65
65
66
66
if ( stream . ReadChar ( ) != 'e' )
67
+ {
68
+ if ( stream . EndOfStream ) throw InvalidBencodeException < BList > . MissingEndChar ( ) ;
67
69
throw InvalidBencodeException < BList > . InvalidEndChar ( stream . ReadPreviousChar ( ) , stream . Position ) ;
70
+ }
68
71
69
72
return list ;
70
73
}
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ public override BNumber Parse(BencodeStream stream)
51
51
52
52
// Last read character should be 'e'
53
53
if ( c != 'e' )
54
+ {
55
+ if ( stream . EndOfStream ) throw InvalidBencodeException < BNumber > . MissingEndChar ( ) ;
54
56
throw InvalidBencodeException < BNumber > . InvalidEndChar ( c , stream . Position ) ;
57
+ }
55
58
56
59
var isNegative = digits [ 0 ] == '-' ;
57
60
var numberOfDigits = isNegative ? digits . Length - 1 : digits . Length ;
You can’t perform that action at this time.
0 commit comments