Fix crash if recipient appears multiple times in group update description.

Without starting from start index, if the same recipient appears
multiple times in the recipient list, this function will crash.
This commit is contained in:
Ehren Kret
2022-04-22 06:55:42 -05:00
committed by GitHub
parent ff8f9ca81a
commit 8c2db972cf

View File

@@ -871,7 +871,7 @@ final class GroupsV2UpdateMessageProducer {
for (RecipientId recipientId : recipientIds) {
String placeholder = makePlaceholder(recipientId);
int placeHolderStart = template.indexOf(placeholder);
int placeHolderStart = template.indexOf(placeholder, startIndex);
String beforeChunk = template.substring(startIndex, placeHolderStart);
builder.append(beforeChunk);