ethdb: handle iostats syntax error

This commit is contained in:
Kurkó Mihály 2018-03-08 13:59:30 +02:00
parent 6a5af0a2b0
commit 894275f183

View file

@ -243,6 +243,10 @@ func (db *LDBDatabase) meter(refresh time.Duration) {
return return
} }
parts := strings.Split(ioStats, " ") parts := strings.Split(ioStats, " ")
if len(parts) < 2 {
db.log.Error("Bad syntax of ioStats", "ioStats", ioStats)
return
}
r := strings.Split(parts[0], ":") r := strings.Split(parts[0], ":")
if len(r) < 2 { if len(r) < 2 {
db.log.Error("Bad syntax of read entry", "entry", parts[0]) db.log.Error("Bad syntax of read entry", "entry", parts[0])