Closed fcharlie closed 5 years ago
@fcharlie The problem of file size and metadata inconsistency is to let users know
@ipipdotnet I think your point of view is correct, but we should return the error instead of letting the process crash directly. Usually, a server process crashes, and the cause of the error is hard to find.
@fcharlie When the data file is incomplete, it will cause the program to crash, but this is not caused by "json.Unmarshal". Let's fix this problem.
When we parse the DB file, the wrong DB file metaLength may be larger than the file size, and illegal address access may occur when calling 'json.Unmarshal' and be killed by the system.