mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-29 21:33:07 -08:00
Throw exception if bad header
This commit is contained in:
1 parent
edf3525a3f
commit
d28a59a2fe
1 file changed
+8
-3
@@ -253,10 +253,15 @@ class DatabaseInputKDBX(cacheDirectory: File,
|
||||
if (size < 0) throw IOException("Corrupted file")
|
||||
|
||||
var data = ByteArray(0)
|
||||
if (size > 0) {
|
||||
if (fieldId != DatabaseHeaderKDBX.PwDbInnerHeaderV4Fields.Binary) {
|
||||
data = dataInputStream.readBytes(size)
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user