diff --git a/CHANGELOG b/CHANGELOG index 91443a1a..f461dac2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ + * Ensure output files are truncated + KeePassDroid (2.5.12) * Fix storing password with biometrics diff --git a/app/src/main/java/com/keepassdroid/Database.java b/app/src/main/java/com/keepassdroid/Database.java index 36b1b9be..76791953 100644 --- a/app/src/main/java/com/keepassdroid/Database.java +++ b/app/src/main/java/com/keepassdroid/Database.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2017 Brian Pellin. + * Copyright 2009-2020 Brian Pellin. * * This file is part of KeePassDroid. * @@ -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."); }