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.
fork-5.53.8
Ehren Kret 2022-04-22 06:55:42 -05:00 zatwierdzone przez GitHub
rodzic ff8f9ca81a
commit 8c2db972cf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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);