Skip to content

Commit

Permalink
fix out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
taowen committed Nov 15, 2017
1 parent 9f088cb commit f7279a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feature_iter_int.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (iter *Iterator) ReadUint32() (ret uint32) {

func (iter *Iterator) readUint32(c byte) (ret uint32) {
defer func() {
if iter.buf[iter.head] == '.' {
if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' {
iter.ReportError("readUint32", "can not decode float as int")
}
}()
Expand Down Expand Up @@ -230,7 +230,7 @@ func (iter *Iterator) ReadUint64() uint64 {

func (iter *Iterator) readUint64(c byte) (ret uint64) {
defer func() {
if iter.buf[iter.head] == '.' {
if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' {
iter.ReportError("readUint64", "can not decode float as int")
}
}()
Expand Down

0 comments on commit f7279a6

Please sign in to comment.