mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Throw exception if bad header
This commit is contained in:
@@ -253,11 +253,16 @@ class DatabaseInputKDBX(cacheDirectory: File,
|
||||
if (size < 0) throw IOException("Corrupted file")
|
||||
|
||||
var data = ByteArray(0)
|
||||
try {
|
||||
if (size > 0) {
|
||||
if (fieldId != DatabaseHeaderKDBX.PwDbInnerHeaderV4Fields.Binary) {
|
||||
data = dataInputStream.readBytes(size)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// OOM only if corrupted file
|
||||
throw IOException("Corrupted file")
|
||||
}
|
||||
|
||||
var result = true
|
||||
when (fieldId) {
|
||||
|
||||
Reference in New Issue
Block a user