Fix potential crash by removing an unnecessary column.

The column I removed is already in the recipient half of the projection.
Having two representations of the groupId made reading the groupId out
of the cursor non-deterministic, and when compounded with another bug,
could cause a crash if one of them was null.
This commit is contained in:
Greyson Parrelli 2020-06-01 16:51:03 -04:00
parent 3fec23fd36
commit f270a6b8c4

View file

@ -760,8 +760,7 @@ public class RecipientDatabase extends Database {
List<RecipientSettings> out = new ArrayList<>(); List<RecipientSettings> out = new ArrayList<>();
String[] columns = ArrayUtils.concat(RECIPIENT_FULL_PROJECTION, String[] columns = ArrayUtils.concat(RECIPIENT_FULL_PROJECTION,
new String[]{ GroupDatabase.TABLE_NAME + "." + GroupDatabase.GROUP_ID, new String[]{GroupDatabase.TABLE_NAME + "." + GroupDatabase.V2_MASTER_KEY });
GroupDatabase.TABLE_NAME + "." + GroupDatabase.V2_MASTER_KEY });
try (Cursor cursor = db.query(table, columns, query, args, null, null, null)) { try (Cursor cursor = db.query(table, columns, query, args, null, null, null)) {
while (cursor != null && cursor.moveToNext()) { while (cursor != null && cursor.moveToNext()) {