From f270a6b8c49cf2e2eb7c7e76588d15778b3a2fb3 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 1 Jun 2020 16:51:03 -0400 Subject: [PATCH] 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. --- .../org/thoughtcrime/securesms/database/RecipientDatabase.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.java b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.java index 3ed46ffd74..b17e61eceb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.java @@ -760,8 +760,7 @@ public class RecipientDatabase extends Database { List out = new ArrayList<>(); String[] columns = ArrayUtils.concat(RECIPIENT_FULL_PROJECTION, - new String[]{ GroupDatabase.TABLE_NAME + "." + GroupDatabase.GROUP_ID, - GroupDatabase.TABLE_NAME + "." + GroupDatabase.V2_MASTER_KEY }); + new String[]{GroupDatabase.TABLE_NAME + "." + GroupDatabase.V2_MASTER_KEY }); try (Cursor cursor = db.query(table, columns, query, args, null, null, null)) { while (cursor != null && cursor.moveToNext()) {