Skip to content

Commit

Permalink
Prevent database corruption when shrinking database size
Browse files Browse the repository at this point in the history
  • Loading branch information
bpellin committed Aug 27, 2020
1 parent 7f5a965 commit 4c31ce9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Ensure output files are truncated

KeePassDroid (2.5.12)
* Fix storing password with biometrics

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/keepassdroid/Database.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2017 Brian Pellin.
* Copyright 2009-2020 Brian Pellin.
*
* This file is part of KeePassDroid.
*
Expand Down Expand Up @@ -214,7 +214,7 @@ public void SaveData(Context ctx, Uri uri) throws IOException, PwDbOutputExcepti
else {
OutputStream os;
try {
os = ctx.getContentResolver().openOutputStream(uri);
os = ctx.getContentResolver().openOutputStream(uri, "wt");
} catch (Exception e) {
throw new IOException("Failed to store database.");
}
Expand Down

0 comments on commit 4c31ce9

Please sign in to comment.