Skip to content

Commit 8b1cca2

Browse files
Add null check on passphrase before clearing
1 parent 2c377fb commit 8b1cca2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

android-database-sqlcipher/src/main/java/net/sqlcipher/database/SupportHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public void setWriteAheadLoggingEnabled(boolean enabled) {
7575
@Override
7676
public SupportSQLiteDatabase getWritableDatabase() {
7777
SQLiteDatabase result = standardHelper.getWritableDatabase(passphrase);
78-
79-
for (int i = 0; i < passphrase.length; i++) {
80-
passphrase[i] = (byte)0;
78+
if(passphrase != null) {
79+
for (int i = 0; i < passphrase.length; i++) {
80+
passphrase[i] = (byte)0;
81+
}
8182
}
82-
8383
return result;
8484
}
8585

0 commit comments

Comments
 (0)